|
8 | 8 | steps: |
9 | 9 | - uses: actions/checkout@v3 |
10 | 10 |
|
11 | | - - run: | |
| 11 | + - name: Verify prerequisites |
| 12 | + run: | |
12 | 13 | if [[ $GITHUB_REF_NAME != main ]]; then |
13 | 14 | echo this workflow should only be run against main |
14 | 15 | exit 1 |
|
21 | 22 |
|
22 | 23 | create-pull-request-against-release-branch: |
23 | 24 | runs-on: ubuntu-latest |
24 | | - needs: prereqs |
| 25 | + needs: |
| 26 | + - prereqs |
25 | 27 | steps: |
26 | 28 | - uses: actions/checkout@v3 |
27 | 29 |
|
@@ -55,21 +57,22 @@ jobs: |
55 | 57 | - name: Create pull request against the release branch |
56 | 58 | env: |
57 | 59 | # not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows |
58 | | - GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} |
| 60 | + GH_TOKEN: ${{ secrets.BOT_TOKEN }} |
59 | 61 | run: | |
60 | 62 | message="Prepare release $VERSION" |
61 | 63 | branch="opentelemetrybot/prepare-release-${VERSION}" |
62 | 64 |
|
| 65 | + git checkout -b $branch |
63 | 66 | git commit -a -m "$message" |
64 | | - git push origin HEAD:$branch |
| 67 | + git push --set-upstream origin $branch |
65 | 68 | gh pr create --title "[$RELEASE_BRANCH_NAME] $message" \ |
66 | 69 | --body "$message." \ |
67 | | - --head $branch \ |
68 | 70 | --base $RELEASE_BRANCH_NAME |
69 | 71 |
|
70 | 72 | create-pull-request-against-main: |
71 | 73 | runs-on: ubuntu-latest |
72 | | - needs: prereqs |
| 74 | + needs: |
| 75 | + - prereqs |
73 | 76 | steps: |
74 | 77 | - uses: actions/checkout@v3 |
75 | 78 |
|
@@ -103,15 +106,15 @@ jobs: |
103 | 106 | - name: Create pull request against main |
104 | 107 | env: |
105 | 108 | # not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows |
106 | | - GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} |
| 109 | + GH_TOKEN: ${{ secrets.BOT_TOKEN }} |
107 | 110 | run: | |
108 | 111 | message="Update version to $NEXT_VERSION" |
109 | 112 | body="Update version to \`$NEXT_VERSION\`." |
110 | 113 | branch="opentelemetrybot/update-version-to-${NEXT_VERSION}" |
111 | 114 |
|
| 115 | + git checkout -b $branch |
112 | 116 | git commit -a -m "$message" |
113 | | - git push origin HEAD:$branch |
| 117 | + git push --set-upstream origin $branch |
114 | 118 | gh pr create --title "$message" \ |
115 | 119 | --body "$body" \ |
116 | | - --head $branch \ |
117 | 120 | --base main |
0 commit comments