Skip to content

Commit 1f1e3db

Browse files
authored
Merge pull request #54 from weierophinney/examples/use-normal-token-for-bump-action
Update workflow documentation and examples
2 parents c41ad9d + 91f7a73 commit 1f1e3db

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,23 @@ That's done by merging the destination into the merge-up branch and resolving th
113113
1. Push (`git push`)
114114

115115
If needed you can create a merge-up branch manually: `git checkout 1.0.x && git checkout -b 1.0.x-merge-up-into-1.1.x`
116+
117+
## Triggering release workflow events
118+
119+
Because the tokens generated by GitHub Actions are considered OAuth tokens,
120+
they are incapable of triggering further workflow events ([see this document for
121+
an explanation](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token)).
122+
123+
As such, if you want to trigger a release event when automatic-releases runs,
124+
you will need to modify your `.github/workflows/release-on-milestone-closed.yml`
125+
file to assign the `ORGANIZATION_ADMIN_TOKEN` as the value of the
126+
`GITHUB_TOKEN` environment variable for the `Release` step:
127+
128+
```yaml
129+
- name: "Release"
130+
uses: "./"
131+
with:
132+
command-name: "laminas:automatic-releases:release"
133+
env:
134+
"GITHUB_TOKEN": ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
135+
```

examples/.github/workflows/release-on-milestone-closed.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
with:
5252
command-name: "laminas:automatic-releases:bump-changelog"
5353
env:
54-
"GITHUB_TOKEN": ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
54+
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
5555
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
5656
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
5757
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

0 commit comments

Comments
 (0)