Skip to content
This repository was archived by the owner on Aug 29, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/actions/copy-workflow-go/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,15 @@ runs:
git add .
git commit -m "run gofmt -s"
fi
- name: add version.json file (in order to deploy versioning workflows)
if: hashFiles(format('{0}/version.json', env.TARGET_REPO_DIR)) == ''
working-directory: ${{ env.TARGET_REPO_DIR }}
shell: bash
run: |
git fetch origin --unshallow # we need the entire commit history
version=$(git describe --tags --abbrev=0 || true) # highest released version on current branch
if [[ -n "$version" ]]; then # only deply version.json if there's at least one release
printf '{"version": "%s"}' "$version" | jq . > version.json
git add version.json
git commit -m "add version.json file"
fi
18 changes: 0 additions & 18 deletions .github/actions/copy-workflow-versioning/action.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .github/workflows/copy-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ jobs:
if: matrix.cfg.deploy_go
# use of ${{ env.TEMPATE_REPO_DIR }} is not allowed here
uses: ./template-repo/.github/actions/copy-workflow-go
- name: Run steps specific to versioning
if: matrix.cfg.deploy_versioning
uses: ./template-repo/.github/actions/copy-workflow-versioning
- name: Add files
run: |
for f in $(jq -r '.[]' <<< ${{ toJson(env.FILES) }}); do
Expand Down
2 changes: 1 addition & 1 deletion configs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ When adding a new JSON config file, please follow the structure of other config
}
```

To customise the copy workflow further, you can add more fields to the `defaults` object. See `deploy_versioning` or `deploy_go` in [go.json](go.json) and how they are used in [copy-workflow.yml](../.github/workflows/copy-workflow.yml) for example.
To customise the copy workflow further, you can add more fields to the `defaults` object. See `deploy_go` in [go.json](go.json) and how it is used in [copy-workflow.yml](../.github/workflows/copy-workflow.yml) for example.

## Testing

Expand Down
11 changes: 5 additions & 6 deletions configs/go.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"defaults": {
"files": [
".github/workflows/automerge.yml",
".github/workflows/go-test.yml",
".github/workflows/go-check.yml",
".github/workflows/releaser.yml",
".github/workflows/release-check.yml",
".github/workflows/automerge.yml",
".github/workflows/go-test.yml",
".github/workflows/go-check.yml",
".github/workflows/releaser.yml",
".github/workflows/release-check.yml",
".github/workflows/tagpush.yml"
],
"deploy_versioning": true,
"deploy_go": true
},
"repositories": [
Expand Down