diff --git a/.github/github-action/action.yml b/.github/github-action/action.yml index 5e5641f..8019592 100644 --- a/.github/github-action/action.yml +++ b/.github/github-action/action.yml @@ -5,6 +5,10 @@ inputs: description: A GitHub token. required: false default: ${{ github.token }} + repo: + description: The owner and repository name. + required: false + default: ${{ github.repository }} runs: using: 'node20' main: 'index.js' diff --git a/.github/github-action/index.js b/.github/github-action/index.js index e845443..26fb69e 100644 --- a/.github/github-action/index.js +++ b/.github/github-action/index.js @@ -25,10 +25,7 @@ async function run() { const githubToken = core.getInput('github_token'); const [owner, repo] = core.getInput('repo').split('/'); - const number = - core.getInput('number') === '' - ? github.context.issue.number - : parseInt(core.getInput('number')); + const number = github.context.issue.number; const octokit = github.getOctokit(githubToken); await octokit.rest.issues.addLabels({ diff --git a/.github/workflows/label-issue.yml b/.github/workflows/label-issue.yml index 8fd1617..5c1aaf0 100644 --- a/.github/workflows/label-issue.yml +++ b/.github/workflows/label-issue.yml @@ -17,4 +17,4 @@ jobs: - name: Add labels uses: ./.github/github-action/ with: - github_token: ${{ secrets.github_token }} + github_token: ${{ secrets.GITHUB_TOKEN }}