Skip to content

Commit

Permalink
Updating action to use node20 (#80)
Browse files Browse the repository at this point in the history
* Updating action to use node20

* Updating README

* Updating workflow
  • Loading branch information
IanWoodard authored Feb 1, 2024
1 parent 86b9938 commit d4b5da6
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 173 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
cache: yarn
node-version: 20

- run: yarn

Expand All @@ -30,7 +31,7 @@ jobs:
private_key: ${{ secrets.INTEGRATION_TEST_APP_PRIVATE_KEY }}

- name: Integration test - checkout private repo
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: getsentry/action-github-app-token-test
token: ${{ steps.my-app.outputs.token }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ You will need to provide the GitHub App ID and private key. The action will then
```
- name: my-app-install token
id: my-app
uses: getsentry/action-github-app-token@v2
uses: getsentry/action-github-app-token@v3
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Checkout private repo
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: getsentry/my-private-repo
token: ${{ steps.my-app.outputs.token }}
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ outputs:
token:
description: 'Github Token for App installation'
runs:
using: 'node16'
using: 'node20'
main: 'dist/index.js'
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@
"node-fetch": "^2.6.1"
},
"dependencies": {
"@actions/core": "^1.10.0",
"@octokit/auth-app": "^4.0.7",
"@octokit/rest": "^19.0.5"
"@actions/core": "^1.10.1",
"@octokit/auth-app": "^6.0.3",
"@octokit/rest": "^20.0.2"
},
"devDependencies": {
"@types/jest": "^27.0.1",
"@types/node": "^12.7.12",
"@typescript-eslint/parser": "^4.30.0",
"@vercel/ncc": "^0.34.0",
"@vercel/ncc": "^0.38.1",
"eslint": "^7.32.0",
"eslint-config-sentry": "^1.60.0",
"eslint-plugin-github": "^4.2.0",
Expand Down
5 changes: 4 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ async function run(): Promise<void> {
let installationId = installations.data[0].id;
if (scope !== '') {
const scopedData = installations.data.find(
(item) => item.account?.login === scope
(item) =>
item.account &&
'login' in item.account &&
item.account?.login === scope
);
if (scopedData === undefined) {
throw new Error(`set scope is ${scope}, but installation is not found`);
Expand Down
Loading

0 comments on commit d4b5da6

Please sign in to comment.