Skip to content

Commit ff559ad

Browse files
chore(ci): fail CI if a personal access token secret is referenced (generated)
algolia/api-clients-automation#6919 Co-authored-by: algolia-api-clients-automation-bot[bot] <288895823+algolia-api-clients-automation-bot[bot]@users.noreply.github.com> Co-authored-by: Eric Zaharia <94015633+eric-zaharia@users.noreply.github.com>
1 parent 2e6f8f4 commit ff559ad

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

.github/workflows/issue.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@ on:
33
issues:
44
types: [opened]
55

6-
permissions:
7-
issues: write
8-
contents: read
6+
# the sync script only reads the event payload and calls the Jira API with its own token
7+
permissions: {}
98

109
jobs:
1110
sync:
1211
runs-on: ubuntu-latest
1312
steps:
1413
- name: Create ticket
1514
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
15+
env:
16+
# env indirection so the secret is never materialized into the composed script
17+
JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}
1618
with:
1719
script: |
1820
const action = context.payload.action;
@@ -27,7 +29,7 @@ jobs:
2729
headers: {
2830
'Accept': 'application/json',
2931
'Content-Type': 'application/json',
30-
'Authorization': `Basic ${{ secrets.JIRA_TOKEN }}`
32+
'Authorization': `Basic ${process.env.JIRA_TOKEN}`
3133
},
3234
body: JSON.stringify({
3335
fields: {

0 commit comments

Comments
 (0)