-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* set default_branch to master for now * update changelog * set git defaultBranch to master in sync action * update changelog * use nextflow.config to set defaultBranch * fix path for nextflow.config grep * change working dir when setting defaultBranch * fix Changelog * Be more verbose in approval check action * fix if clause * update changelog * add verbose mode to sync action * update changelog * Apply suggestions from code review * add input debug for workflow_dispatch sync action * go back to original directory after configuring git defaultBranch * add more debugging on sync GHA * echo message to sync GHA * try exiting pipeline directory before saving defaultBranch * cleanup debugging echo * use same ref in checkout as triggered the workflow * don't set up loggin level to error * Revert "don't set up loggin level to error [no changelog]" * Update nf_core/pipeline-template/.github/workflows/awsfulltest.yml --------- Co-authored-by: Júlia Mir Pedrol <[email protected]>
- Loading branch information
Showing
5 changed files
with
44 additions
and
8 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 |
---|---|---|
|
@@ -23,6 +23,10 @@ on: | |
description: "Pipeline to sync" | ||
type: string | ||
default: "all" | ||
debug: | ||
description: "Enable debug/verbose mode (true or false)" | ||
type: boolean | ||
default: false | ||
|
||
# Cancel if a newer run is started | ||
concurrency: | ||
|
@@ -62,6 +66,8 @@ jobs: | |
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||
name: Check out nf-core/tools | ||
with: | ||
ref: ${{ github.ref_name }} | ||
|
||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||
name: Check out nf-core/${{ matrix.pipeline }} | ||
|
@@ -87,14 +93,29 @@ jobs: | |
with: | ||
version: "latest-everything" | ||
|
||
- name: Set Git default branch from nextflow.config and set git default branch to that or "master" | ||
|
||
run: | | ||
pushd nf-core/${{ matrix.pipeline }} | ||
defaultBranch=$(grep -B5 -A5 "nextflowVersion" nextflow.config | grep "defaultBranch" | cut -d"=" -f2) | ||
if [ -z "$defaultBranch" ]; then | ||
defaultBranch="master" | ||
fi | ||
popd | ||
echo "Default branch: $defaultBranch" | ||
echo "defaultBranch=$defaultBranch" >> GITHUB_OUTPUT | ||
git config --global init.defaultBranch $defaultBranch | ||
- name: Run synchronisation | ||
if: github.repository == 'nf-core/tools' | ||
env: | ||
GITHUB_AUTH_TOKEN: ${{ secrets.nf_core_bot_auth_token }} | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "nf-core-bot" | ||
nf-core --log-file sync_log_${{ matrix.pipeline }}.txt pipelines sync -d nf-core/${{ matrix.pipeline }} \ | ||
nf-core --log-file sync_log_${{ matrix.pipeline }}.txt \ | ||
${{ github.event.inputs.debug == 'true' && '--verbose' || '' }} \ | ||
pipelines sync -d nf-core/${{ matrix.pipeline }} \ | ||
--from-branch dev \ | ||
--pull-request \ | ||
--username nf-core-bot \ | ||
|
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
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 |
---|---|---|
|
@@ -19,19 +19,30 @@ jobs: | |
if: github.repository == '{{ name }}' && github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'master' || github.event_name == 'workflow_dispatch' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: octokit/[email protected] | ||
- name: Get PR reviews | ||
uses: octokit/[email protected] | ||
if: github.event_name != 'workflow_dispatch' | ||
id: check_approvals | ||
continue-on-error: true | ||
with: | ||
route: GET /repos/{%- raw -%}${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews?per_page=100 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- id: test_variables | ||
|
||
- name: Check for approvals | ||
if: ${{ failure() && github.event_name != 'workflow_dispatch' }} | ||
run: | | ||
echo "No review approvals found. At least 2 approvals are required to run this action automatically." | ||
exit 1 | ||
- name: Check for enough approvals (>=2) | ||
id: test_variables | ||
if: github.event_name != 'workflow_dispatch' | ||
run: | | ||
JSON_RESPONSE='${{ steps.check_approvals.outputs.data }}'{% endraw %} | ||
CURRENT_APPROVALS_COUNT=$(echo $JSON_RESPONSE | jq -c '[.[] | select(.state | contains("APPROVED")) ] | length') | ||
test $CURRENT_APPROVALS_COUNT -ge 2 || exit 1 # At least 2 approvals are required | ||
- name: Launch workflow via Seqera Platform | ||
uses: seqeralabs/action-tower-launch@v2 | ||
# TODO nf-core: You can customise AWS full pipeline tests as required | ||
|
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
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