File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Open release PR
2+ description : Commit prepared release files and open a pull request
3+
4+ inputs :
5+ app-slug :
6+ description : Slug of the GitHub App used to open the pull request
7+ required : true
8+ token :
9+ description : GitHub App token with contents and pull request write access
10+ required : true
11+ package-path :
12+ description : Path to the package to release
13+ required : true
14+ pr-body :
15+ description : Pull request body
16+ required : true
17+ tag :
18+ description : Release tag
19+ required : true
20+ version :
21+ description : Release version
22+ required : true
23+
24+ runs :
25+ using : composite
26+ steps :
27+ - name : Open release PR
28+ shell : bash
29+ env :
30+ APP_SLUG : ${{ inputs.app-slug }}
31+ GH_TOKEN : ${{ inputs.token }}
32+ PACKAGE_NAME : ${{ inputs.package-name }}
33+ PACKAGE_PATH : ${{ inputs.package-path }}
34+ PR_BODY : ${{ inputs.pr-body }}
35+ TAG : ${{ inputs.tag }}
36+ VERSION : ${{ inputs.version }}
37+ run : |
38+ BRANCH="release-$PACKAGE_NAME-$VERSION-$GITHUB_RUN_ID"
39+ BOT_ID="$(gh api "/users/$APP_SLUG%5Bbot%5D" --jq .id)"
40+ git config user.name "$APP_SLUG[bot]"
41+ git config user.email "$BOT_ID+$APP_SLUG[bot]@users.noreply.github.com"
42+ git switch -c "$BRANCH"
43+ git add "$PACKAGE_PATH"
44+ git commit -m "release: $TAG"
45+ git push -u "https://x-access-token:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.git" HEAD
46+ gh pr create \
47+ --assignee "$GITHUB_ACTOR" \
48+ --base main \
49+ --head "$BRANCH" \
50+ --title "release: $TAG" \
51+ --body "$PR_BODY"
You can’t perform that action at this time.
0 commit comments