Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New branch for testing #5

Merged
merged 16 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/checklist.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[ ] item 1
[ ] item 2
- [ ] item 1
- [ ] item 2
- [ ] item 3
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down