generated from ubiquity/ts-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: switch knip workflow to workflow_run
- Loading branch information
1 parent
87cd2a8
commit 193a5d7
Showing
2 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
name: Knip | ||
|
||
on: | ||
pull_request: | ||
workflow_run: | ||
workflows: ["Build"] | ||
types: | ||
- completed | ||
|
||
permissions: | ||
checks: write | ||
|
@@ -11,8 +14,27 @@ jobs: | |
run-knip: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: 'Download artifact' | ||
uses: actions/[email protected] | ||
with: | ||
script: | | ||
var artifacts = await github.actions.listWorkflowRunArtifacts({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
run_id: ${{github.event.workflow_run.id }}, | ||
}); | ||
var matchArtifact = artifacts.data.artifacts.filter((artifact) => { | ||
return artifact.name == "static" | ||
})[0]; | ||
var download = await github.actions.downloadArtifact({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
artifact_id: matchArtifact.id, | ||
archive_format: 'zip', | ||
}); | ||
var fs = require('fs'); | ||
fs.writeFileSync('${{github.workspace}}/static.zip', Buffer.from(download.data)); | ||
- run: unzip static.zip | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[33mcommit 87cd2a88a2350d6a33783828558f597aa3402e18[m[33m ([m[1;36mHEAD[m[33m -> [m[1;32mknip-configuration-for-keygen[m[33m)[m | ||
Author: Korrrba <[email protected]> | ||
Date: Tue Mar 19 15:45:50 2024 +0100 | ||
|
||
chore: remove workflow_dispatch, restrict write permissions to checks and issues for knip workflow | ||
|
||
[1mdiff --git a/.github/workflows/knip.yml b/.github/workflows/knip.yml[m | ||
[1mindex b686ba2..811280d 100644[m | ||
[1m--- a/.github/workflows/knip.yml[m | ||
[1m+++ b/.github/workflows/knip.yml[m | ||
[36m@@ -2,9 +2,10 @@[m [mname: Knip[m | ||
[m | ||
on:[m | ||
pull_request:[m | ||
[31m- workflow_dispatch:[m | ||
[m | ||
[31m-permissions: write-all[m | ||
[32m+[m[32mpermissions:[m | ||
[32m+[m[32m checks: write[m | ||
[32m+[m[32m issues: write[m | ||
[m | ||
jobs:[m | ||
run-knip:[m |