diff --git a/.github/checklist.md b/.github/checklist.md index ea6daeb..c6f1464 100644 --- a/.github/checklist.md +++ b/.github/checklist.md @@ -1,2 +1,3 @@ -[ ] item 1 -[ ] item 2 \ No newline at end of file +- [ ] item 1 +- [ ] item 2 +- [ ] item 3 \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d8aaff6..9f62358 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,6 +7,9 @@ on: jobs: test: runs-on: ubuntu-22.04 + permissions: + contents: read + pull-requests: write steps: - name: Check out repo uses: actions/checkout@v4 diff --git a/action.yml b/action.yml index 371855c..488e033 100644 --- a/action.yml +++ b/action.yml @@ -5,7 +5,7 @@ inputs: description: 'Path of checklist location relative to the context of files available in the runner' default: "./.github/checklist.md" required: true - repo_token: + github_token: description: "A GitHub token for API access. Defaults to {{ github.token }}." default: "${{ github.token }}" required: true diff --git a/index.js b/index.js index b67a8ba..f729a19 100644 --- a/index.js +++ b/index.js @@ -3,13 +3,19 @@ const fs = require("fs/promises"); const github = require('@actions/github'); const checklistPath = core.getInput('checklist_path'); -const repoToken = core.getInput('repo_token'); -const octokit = github.getOctokit(repoToken); +const githubToken = core.getInput('github_token'); + +const octokit = github.getOctokit(githubToken); (async () => { try { const checklistContent = await fs.readFile(checklistPath, "utf8"); - console.log(github.context); + octokit.rest.issues.createComment({ + issue_number: github.context.issue.number, + owner: github.context.repo.owner, + repo: github.context.repo.repo, + body: checklistContent, + }); } catch (error) { console.log(error.message); } diff --git a/package.json b/package.json index b0428db..a79716c 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,6 @@ "version": "1.0.0", "description": "", "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, "keywords": [], "author": "", "license": "ISC",