This repository has been archived by the owner on Aug 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: generalise copy-workflow to cover update-go and delete-template…
…s too
- Loading branch information
Showing
9 changed files
with
151 additions
and
174 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Copy Templates | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
targets: | ||
description: "List of repository names to deploy to" | ||
required: true | ||
|
||
jobs: | ||
copy: | ||
uses: protocol/.github/workflows/process.yml@v1.0.0 | ||
with: | ||
targets: ${{ github.event.inputs.targets }} | ||
branch: web3-bot/copy-templates | ||
script: copy-templates.sh | ||
defaults: | | ||
{ | ||
"Go": { | ||
"files": [ | ||
".github/workflows/go-test.yml", | ||
".github/workflows/go-check.yml", | ||
".github/workflows/releaser.yml", | ||
".github/workflows/release-check.yml", | ||
".github/workflows/tagpush.yml", | ||
"version.json" | ||
] | ||
}, | ||
"JavaScript": { | ||
"files": [ | ||
".github/workflows/js-test-and-release.yml" | ||
] | ||
}, | ||
"TypeScript": { | ||
"files": [ | ||
".github/workflows/js-test-and-release.yml" | ||
] | ||
} | ||
} |
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,23 @@ | ||
name: Delete Templates | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
targets: | ||
description: "List of repository names to deploy to" | ||
required: true | ||
files: | ||
description: "List of files to delete" | ||
required: true | ||
|
||
jobs: | ||
copy: | ||
uses: protocol/.github/workflows/process.yml@v1.0.0 | ||
with: | ||
targets: ${{ github.event.inputs.targets }} | ||
branch: web3-bot/delete-templates | ||
script: delete-templates.sh | ||
override: | | ||
{ | ||
"files": ${{ github.event.inputs.files }} | ||
} |
This file was deleted.
Oops, something went wrong.
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,25 @@ | ||
name: Update Go | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
targets: | ||
description: "List of repository names to deploy to" | ||
required: true | ||
go: | ||
description: "Go version to use" | ||
required: true | ||
|
||
jobs: | ||
copy: | ||
uses: protocol/.github/workflows/process.yml@v1.0.0 | ||
with: | ||
targets: ${{ github.event.inputs.targets }} | ||
branch: web3-bot/update-go | ||
script: copy-templates.sh | ||
defaults: | | ||
{ | ||
"Go": { | ||
"version": "${{ github.event.inputs.go }}" | ||
} | ||
} |
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail -o nounset | ||
|
||
for f in $(jq -r '.config.files[]' <<< "$CONTEXT"); do | ||
echo -e "\nProcessing $f." | ||
if [[ ! -f "$REPO/$f" ]]; then | ||
echo "$f does not exist. Skipping.\n" | ||
continue | ||
fi | ||
|
||
rm -rf "$REPO/$f" | ||
done | ||
|
||
pushd $REPO > /dev/null | ||
|
||
git add . | ||
|
||
if ! git diff-index --quiet HEAD; then | ||
git commit -m "chore: delete templates" | ||
fi | ||
|
||
popd > /dev/null |
Oops, something went wrong.