1313jobs :
1414 pin-system-tests :
1515 name : " Pin system tests"
16- # CHANGE BACK TO release/v*
17- if : github.event_name != 'create' || startsWith(github.ref, 'refs/heads/test/v')
16+ if : github.event_name != 'create' || startsWith(github.ref, 'refs/heads/release/v')
1817 runs-on : ubuntu-latest
1918 permissions :
20- contents : write # may not be needed
21- id-token : write # Required for OIDC token federation
19+ contents : write
20+ id-token : write # required for OIDC token federation
2221 steps :
2322 - uses : DataDog/dd-octo-sts-action@acaa02eee7e3bb0839e4272dacb37b8f3b58ba80 # v1.0.3
2423 id : octo-sts
@@ -55,11 +54,10 @@ jobs:
5554 run : |
5655 BRANCH=${{ steps.define-branch.outputs.branch }}
5756 if git ls-remote --heads origin "$BRANCH" | grep -q "$BRANCH"; then
58- echo "creating_new_branch=false" >> "$GITHUB_OUTPUT "
59- echo "Branch $BRANCH already exists - please delete it and re-run the workflow."
57+ echo "ERROR: Branch $BRANCH already exists - please delete it and re-run the workflow. "
58+ exit 1
6059 else
61- echo "creating_new_branch=true" >> "$GITHUB_OUTPUT"
62- echo "Branch $BRANCH does not exist - creating it now"
60+ echo "Branch $BRANCH does not exist - creating it now."
6361 fi
6462
6563 - name : Update system-tests references to latest commit SHA on main
@@ -69,16 +67,14 @@ jobs:
6967 id : check-changes
7068 run : |
7169 if [[ -z "$(git status -s)" ]]; then
72- echo "No changes to commit, exiting ."
73- echo "commit_changes=false" >> "$GITHUB_OUTPUT"
70+ echo "ERROR: No changes to commit - the system-tests reference was not updated ."
71+ exit 1
7472 else
75- echo "commit_changes=true" >> "$GITHUB_OUTPUT"
7673 echo "Changes to commit:"
7774 git status -s
7875 fi
7976
8077 - name : Commit changes
81- if : steps.check-changes.outputs.commit_changes == 'true'
8278 id : create-commit
8379 run : |
8480 git config user.name "github-actions[bot]"
8884
8985 - name : Push changes
9086 uses : DataDog/commit-headless@5a0f3876e0fbdd3a86b3e008acf4ec562db59eee # action/v2.0.1
91- if : steps.check-changes.outputs.commit_changes == 'true' && steps.check-branch.outputs.creating_new_branch == 'true'
9287 with :
9388 token : " ${{ steps.octo-sts.outputs.token }}"
9489 branch : " ${{ steps.define-branch.outputs.branch }}"
@@ -98,15 +93,12 @@ jobs:
9893 commits : " ${{ steps.create-commit.outputs.commit }}"
9994
10095 - name : Create pull request
101- if : steps.check-changes.outputs.commit_changes == 'true' && steps.check-branch.outputs.creating_new_branch == 'true'
10296 env :
10397 GH_TOKEN : ${{ steps.octo-sts.outputs.token }}
104- # REMOVE DRAFT
10598 run : |
10699 gh pr create --title "Pin system tests for release branch" \
107100 --base ${{ steps.define-base-branch.outputs.base_branch }} \
108101 --head ${{ steps.define-branch.outputs.branch }} \
109102 --label "tag: dependencies" \
110103 --label "tag: no release notes" \
111104 --body "This PR pins the system-tests reference for the release branch." \
112- --draft
0 commit comments