forked from aws-amplify/amplify-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
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
2 changed files
with
35 additions
and
27 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: tag_trigger_action | ||
description: Trigger a workflow on a tag addition | ||
inputs: | ||
tag-name: | ||
description: 'The tag to trigger the workflow on' | ||
required: true | ||
test-name: | ||
description: 'The name of the test to run' | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
# if this workflow is running on a push (ie merge to main), then tag tests always run | ||
# if this workflow is triggered manually, then tag tests always run | ||
# if the workflow is running on a pull request, we perform an additional check for the <tag> label | ||
# this is not a security measure (that is already handled by the pull_request event behavior) but rather a way for PR authors to easily check tag test results if they wish | ||
# the reason it doesn't run all the time is because it will always fail for external contributor PRs (they don't have access to repo secrets) and we don't want to waste resources running tag on every PR commit | ||
- shell: bash | ||
run: | | ||
if [[ ${{ github.event_name }} == 'push' ]] || [[ ${{ github.event_name }} == 'workflow_dispatch' ]] || gh api /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }} | jq -r '.labels[].name' | grep ${{ inputs.tag-name }} --quiet; then | ||
echo setting run_e2e to true; | ||
echo "run_e2e=true" >> "$GITHUB_OUTPUT"; | ||
else | ||
echo setting run_e2e to false; | ||
echo "run_e2e=false" >> "$GITHUB_OUTPUT"; | ||
fi |
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