@@ -36,16 +36,12 @@ jobs:
3636
3737 runs-on : ubuntu-latest
3838
39- # When manually triggering the build, the requester can specify a target branch or a tag
40- # via the 'ref' client parameter.
4139 steps :
4240 - name : Check out code
43- uses : actions/checkout@v4
44- with :
45- ref : ${{ github.event.client_payload.ref || github.ref }}
41+ uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
4642
4743 - name : Set up Go
48- uses : actions/setup-go@v5
44+ uses : actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
4945 with :
5046 go-version : ' 1.23'
5147
@@ -71,57 +67,34 @@ jobs:
7167 # 3. with the label 'release:publish', and
7268 # 4. the title prefix '[chore] Release '.
7369 if : github.event.pull_request.merged &&
74- github.ref == 'refs/heads/ dev' &&
70+ github.base_ref == 'dev' &&
7571 contains(github.event.pull_request.labels.*.name, 'release:publish') &&
7672 startsWith(github.event.pull_request.title, '[chore] Release ')
7773
7874 runs-on : ubuntu-latest
7975 permissions :
80- contents : write
76+ pull-requests : write
8177
8278 steps :
8379 - name : Checkout source for publish
84- uses : actions/checkout@v4
80+ uses : actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
8581 with :
82+ ref : dev
8683 persist-credentials : false
8784
8885 - name : Publish preflight check
8986 id : preflight
9087 run : ./.github/scripts/publish_preflight_check.sh
9188
92- # We authorize this step with an access token that has write access to the master branch.
93- - name : Merge to master
94- uses : actions/github-script@v7
95- with :
96- github-token : ${{ secrets.FIREBASE_GITHUB_TOKEN }}
97- script : |
98- github.rest.repos.merge({
99- owner: context.repo.owner,
100- repo: context.repo.repo,
101- base: 'master',
102- head: 'dev'
103- })
104-
105- # See: https://cli.github.com/manual/gh_release_create
106- - name : Create release tag
89+ # Create a PR to merge dev into master.
90+ - name : Create Release PR
10791 env :
10892 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
109- run : gh release create ${{ steps.preflight.outputs.version }}
110- --title "Firebase Admin Go SDK ${{ steps.preflight.outputs.version }}"
111- --notes '${{ steps.preflight.outputs.changelog }}'
112- --target "master"
113-
114- # Post to Twitter if explicitly opted-in by adding the label 'release:tweet'.
115- - name : Post to Twitter
116- if : success() &&
117- contains(github.event.pull_request.labels.*.name, 'release:tweet')
118- uses : firebase/firebase-admin-node/.github/actions/send-tweet@master
119- with :
120- status : >
121- ${{ steps.preflight.outputs.version }} of @Firebase Admin Go SDK is available.
122- https://github.com/firebase/firebase-admin-go/releases/tag/${{ steps.preflight.outputs.version }}
123- consumer-key : ${{ secrets.FIREBASE_TWITTER_CONSUMER_KEY }}
124- consumer-secret : ${{ secrets.FIREBASE_TWITTER_CONSUMER_SECRET }}
125- access-token : ${{ secrets.FIREBASE_TWITTER_ACCESS_TOKEN }}
126- access-token-secret : ${{ secrets.FIREBASE_TWITTER_ACCESS_TOKEN_SECRET }}
127- continue-on-error : true
93+ RELEASE_BODY : ${{ steps.preflight.outputs.changelog }}
94+ RELEASE_TITLE : " [chore] Release ${{ steps.preflight.outputs.version }}"
95+ run : |
96+ gh pr create \
97+ --base master \
98+ --head dev \
99+ --title "$RELEASE_TITLE" \
100+ --body "$RELEASE_BODY"
0 commit comments