Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
fix(action): remove repo, context parameters #1
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiejaoude committed Sep 5, 2020
1 parent 5709874 commit a4633ef
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/community.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ jobs:
- uses: EddieJaoudeCommunity/gh-action-community@main
with:
github-token: ${{secrets.GITHUB_TOKEN}}
repo: ${{ toJson(github) }}
context: ${{ toJson(context) }}
6 changes: 0 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ inputs:
github-token:
description: 'repo access'
required: true
repo:
description: 'repo info'
required: true
context:
description: 'context of repo'
required: true
runs:
using: 'node12'
main: 'index.js'
10 changes: 4 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@ const github = require('@actions/github');
(async () => {
try {
// const githubSecret = core.getInput('github-secret');
const repo = core.getInput('repo');
const context = core.getInput('context');

const creator = context.payload.sender.login;
const opts = repo.issues.listForRepo.endpoint.merge({
const opts = github.issues.listForRepo.endpoint.merge({
...context.issue,
creator,
state: 'all',
});
const issues = await repo.paginate(opts);
const issues = await github.paginate(opts);

for (const issue of issues) {
if (issue.number === context.issue.number) {
Expand All @@ -27,8 +25,8 @@ const github = require('@actions/github');

await repo.issues.createComment({
issue_number: github.context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
owner: context.github.owner,
repo: context.github.repo,
body: 'Welcome, new contributor!',
});
} catch (error) {
Expand Down

0 comments on commit a4633ef

Please sign in to comment.