-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
0 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,58 +16,3 @@ jobs: | |
ref: master | ||
repository: ${{ github.repository }} | ||
path: repos/cgns_doc | ||
|
||
- name: Checkout the CGNS source repository (master branch) | ||
uses: actions/[email protected] | ||
with: | ||
ref: master | ||
repository: 'CGNS/CGNS' | ||
path: repos/cgns_src | ||
|
||
- name: Get commit history for docs repository | ||
id: get_commits_doc_repo | ||
run: | | ||
cd repos/cgns_doc | ||
last_day=$(date -d 'yesterday' '+%Y-%m-%d') | ||
first_commit_hash=$(git rev-list --max-count=1 --before="$last_day" HEAD) | ||
echo "FIRST_COMMIT_HASH_DOC_REPO=$first_commit_hash" >> $GITHUB_OUTPUT | ||
- name: Get commit history for source repository | ||
id: get_commits_src_repo | ||
run: | | ||
cd repos/cgns_src | ||
last_day=$(date -d 'yesterday' '+%Y-%m-%d') | ||
first_commit_hash=$(git rev-list --max-count=1 --before="$last_day" HEAD) | ||
echo "FIRST_COMMIT_HASH_SRC_REPO=$first_commit_hash" >> $GITHUB_OUTPUT | ||
- name: Check if any commits exist in either repository | ||
id: has_commits | ||
run: | | ||
if [[ -z "${{ steps.get_commits_doc_repo.outputs.FIRST_COMMIT_HASH_DOC_REPO }}" ]] && | ||
[[ -z "${{ steps.get_commits_src_repo.outputs.FIRST_COMMIT_HASH_SRC_REPO }}" ]]; then | ||
echo "HAS_COMMITS=false" >> $GITHUB_OUTPUT | ||
else | ||
echo "HAS_COMMITS=true" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Log result and trigger another workflow | ||
run: | | ||
if [[ "${{ steps.has_commits.outputs.HAS_COMMITS }}" == "true" ]]; then | ||
echo "Changes found in the previous day." | ||
# Trigger another workflow | ||
echo "::set-output name=trigger_next_workflow::true" | ||
else | ||
echo "No changes found in the previous day." | ||
fi | ||
sdfdsfsdf | ||
# - name: Trigger downstream workflow (optional) | ||
# uses: actions/github-script@v6 | ||
# if: ${{ steps.log_result.outputs.trigger_next_workflow }} | ||
# with: | ||
# script: | | ||
# github.actions.createWorkflowDispatch({ | ||
# owner: 'CGNS', | ||
# repo: 'cgns.github.io ', | ||
# workflow_id: 'publish.yml', | ||
# ref: ${{ github.ref }} | ||
# }) |