-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for
ghasum update
to ignore errors in the sumfile
Update the `ghasum update` CLI to accept a `-force` flag that can be used to force updating to ignore and fix any errors in the gha.sum file.
- Loading branch information
1 parent
720c940
commit 1e89ccb
Showing
7 changed files
with
152 additions
and
16 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
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 |
---|---|---|
|
@@ -46,6 +46,7 @@ const ( | |
|
||
const ( | ||
flagNameCache = "cache" | ||
flagNameForce = "force" | ||
flagNameNoCache = "no-cache" | ||
) | ||
|
||
|
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
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
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
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
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,112 @@ | ||
# Error in entries | ||
exec ghasum update -cache .cache/ -force entries/ | ||
stdout 'Ok' | ||
! stderr . | ||
cmp entries/.github/workflows/gha.sum .want/gha.sum | ||
|
||
# Error in headers | ||
exec ghasum update -cache .cache/ -force headers/ | ||
stdout 'Ok' | ||
! stderr . | ||
cmp headers/.github/workflows/gha.sum .want/gha.sum | ||
|
||
# Error in version | ||
exec ghasum update -cache .cache/ -force nan-version/ | ||
stdout 'Ok' | ||
! stderr . | ||
cmp nan-version/.github/workflows/gha.sum .want/gha.sum | ||
|
||
# Invalid version | ||
exec ghasum update -cache .cache/ -force invalid-version/ | ||
stdout 'Ok' | ||
! stderr . | ||
cmp invalid-version/.github/workflows/gha.sum .want/gha.sum | ||
|
||
# Missing version | ||
exec ghasum update -cache .cache/ -force no-version/ | ||
stdout 'Ok' | ||
! stderr . | ||
cmp no-version/.github/workflows/gha.sum .want/gha.sum | ||
|
||
-- entries/.github/workflows/gha.sum -- | ||
version 1 | ||
|
||
this-action/is-missing@a-checksum | ||
-- entries/.github/workflows/workflow.yml -- | ||
name: Example workflow | ||
on: [push] | ||
|
||
jobs: | ||
example: | ||
name: example | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/[email protected] | ||
-- headers/.github/workflows/gha.sum -- | ||
invalid-header | ||
|
||
actions/[email protected] GGAV+/JnlPt41B9iINyvcX5z6a4ue+NblmwiDNVORz0= | ||
-- headers/.github/workflows/workflow.yml -- | ||
name: Example workflow | ||
on: [push] | ||
|
||
jobs: | ||
example: | ||
name: example | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/[email protected] | ||
-- invalid-version/.github/workflows/gha.sum -- | ||
version 0 | ||
|
||
actions/[email protected] GGAV+/JnlPt41B9iINyvcX5z6a4ue+NblmwiDNVORz0= | ||
-- invalid-version/.github/workflows/workflow.yml -- | ||
name: Example workflow | ||
on: [push] | ||
|
||
jobs: | ||
example: | ||
name: example | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/[email protected] | ||
-- nan-version/.github/workflows/gha.sum -- | ||
version not-a-number | ||
|
||
actions/[email protected] GGAV+/JnlPt41B9iINyvcX5z6a4ue+NblmwiDNVORz0= | ||
-- nan-version/.github/workflows/workflow.yml -- | ||
name: Example workflow | ||
on: [push] | ||
|
||
jobs: | ||
example: | ||
name: example | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/[email protected] | ||
-- no-version/.github/workflows/gha.sum -- | ||
version-header-missing 1 | ||
|
||
actions/[email protected] GGAV+/JnlPt41B9iINyvcX5z6a4ue+NblmwiDNVORz0= | ||
-- no-version/.github/workflows/workflow.yml -- | ||
name: Example workflow | ||
on: [push] | ||
|
||
jobs: | ||
example: | ||
name: example | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/[email protected] | ||
-- .cache/actions/checkout/v4.1.1/.keep -- | ||
This file exist to avoid fetching "actions/[email protected]" and give the Action | ||
a unique checksum. | ||
-- .want/gha.sum -- | ||
version 1 | ||
|
||
actions/[email protected] KsR9XQGH7ydTl01vlD8pIZrXhkzXyjcnzhmP+/KaJZI= |