Skip to content

Commit e758cd8

Browse files
committed
chore(ci): Give requireReleseLabel access to github token
1 parent b9b6f2e commit e758cd8

3 files changed

Lines changed: 24 additions & 2 deletions

File tree

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
name: 'Require Release Label Conditional'
22
description: 'Require release labels on PRs unless title starts with conventional commit prefixes'
3+
4+
inputs:
5+
github-token:
6+
description: 'GitHub token for setting milestones'
7+
required: false
8+
default: ''
9+
310
runs:
4-
using: 'node20'
11+
using: 'node24'
512
main: 'requireReleaseLabelOrCcMessage.mjs'

.github/actions/require-release-label-or-cc-message/requireReleaseLabelOrCcMessage.mjs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,27 @@ const env = {
3333
*/
3434
GITHUB_EVENT_PATH: process.env.GITHUB_EVENT_PATH || '',
3535
/** `GITHUB_TOKEN` - GitHub token for API requests */
36-
GITHUB_TOKEN: process.env.GITHUB_TOKEN || '',
36+
GITHUB_TOKEN:
37+
process.env.INPUT_GITHUB_TOKEN || process.env['INPUT_GITHUB-TOKEN'] || '',
3738
/** `GITHUB_REPOSITORY` - The owner and repository name */
3839
GITHUB_REPOSITORY: process.env.GITHUB_REPOSITORY || '',
3940
}
4041

4142
import fs from 'node:fs'
4243

4344
async function main() {
45+
// Debug: Log available environment variables
46+
console.log('Environment variables check:')
47+
console.log(
48+
'INPUT_GITHUB_TOKEN:',
49+
process.env.INPUT_GITHUB_TOKEN ? 'SET' : 'NOT SET',
50+
)
51+
console.log(
52+
'INPUT_GITHUB-TOKEN:',
53+
process.env['INPUT_GITHUB-TOKEN'] ? 'SET' : 'NOT SET',
54+
)
55+
console.log('env.GITHUB_TOKEN:', env.GITHUB_TOKEN ? 'SET' : 'NOT SET')
56+
4457
const event = fs.readFileSync(env.GITHUB_EVENT_PATH, 'utf-8')
4558

4659
/** @type {GitHubEvent} */

.github/workflows/require-release-label.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ jobs:
2929

3030
- name: ✅ Check release label requirement
3131
uses: ./.github/actions/require-release-label-or-cc-message
32+
with:
33+
github-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)