Skip to content

Commit

Permalink
refactor: rename ACCESS_TOKEN -> INVITE_TOKEN
Browse files Browse the repository at this point in the history
  • Loading branch information
vj-abishek committed Jan 23, 2021
1 parent 908b48b commit e508367
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Invite on label
uses: vj-abigo/[email protected]
uses: vj-abigo/[email protected]
with:
organization: vj-abigo
label: invite me
repo-token: ${{ secrets.GITHUB_TOKEN }}
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
INVITE_TOKEN: ${{ secrets.INVITE_TOKEN }}
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<p>
<h1 align="center">Invite-on-label</h1>
</p>
Expand All @@ -24,7 +23,7 @@ jobs:
label: invite me to the organisation
repo-token: ${{ secrets.GITHUB_TOKEN }}
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
INVITE_TOKEN: ${{ secrets.INVITE_TOKEN }}
```
**_organization_** - _(required)_ name of the organization to which you would like to invite your contributors
Expand All @@ -35,4 +34,4 @@ jobs:
> Default comment: `Invitation sent for the GitHub Organisation. Welcome to the community`

**NOTE:** create a [repository secret](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets) called _`ACCESS_TOKEN`_ _(or give it another name, but don't forget to change it in the workflow)_ and as a value provide a GitHub [personal access token](https://github.com/settings/tokens) with the scope of _`admin:org`_
**NOTE:** create a [repository secret](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets) called _`INVITE_TOKEN`_ _(or give it another name, but don't forget to change it in the workflow)_ and as a value provide a GitHub [personal access token](https://github.com/settings/tokens) with the scope of _`admin:org`_
8 changes: 4 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ const github = __nccwpck_require__(438);

const main = async () => {
try {
const { ACCESS_TOKEN } = process.env;
const { INVITE_TOKEN } = process.env;
const repoToken = core.getInput('repo-token', { required: true });

if (!ACCESS_TOKEN) {
return core.setFailed('ENV required and not supplied: ACCESS_TOKEN');
if (!INVITE_TOKEN) {
return core.setFailed('ENV required and not supplied: INVITE_TOKEN');
}

const octokit = github.getOctokit(ACCESS_TOKEN);
const octokit = github.getOctokit(INVITE_TOKEN);
const client = github.getOctokit(repoToken);

const { payload } = github.context;
Expand Down
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ const github = require('@actions/github');

const main = async () => {
try {
const { ACCESS_TOKEN } = process.env;
const { INVITE_TOKEN } = process.env;
const repoToken = core.getInput('repo-token', { required: true });

if (!ACCESS_TOKEN) {
return core.setFailed('ENV required and not supplied: ACCESS_TOKEN');
if (!INVITE_TOKEN) {
return core.setFailed('ENV required and not supplied: INVITE_TOKEN');
}

const octokit = github.getOctokit(ACCESS_TOKEN);
const octokit = github.getOctokit(INVITE_TOKEN);
const client = github.getOctokit(repoToken);

const { payload } = github.context;
Expand Down

0 comments on commit e508367

Please sign in to comment.