Templatize commit-report-sync workflow
This commit is contained in:
parent
67f73b8752
commit
6ff40880d1
@ -6,18 +6,38 @@ jobs:
|
|||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
# If I were going to make this as a template, I'd instead use the `${{ github.[...] }} context to determin owner
|
# It's still _so_ baffling to me that this doesn't appear to be available in the `github` context.
|
||||||
# and name directly from the context.
|
- name: Determine repo name
|
||||||
# I'm leaving that off because it'd require a whole other step (to pipe `github.repository` through a splitting
|
run: |
|
||||||
# tool, because there's only `github.repository_owner`, no `github.repository_name`)
|
echo "Test output"
|
||||||
#
|
echo \"${{ github.repository }}\" | cut-d'/' -f2
|
||||||
# (And the token should be retrieved from Vault)
|
echo "REPO_NAME=$(echo \"${{ github.repository }}\" | cut-d'/' -f2)" >> "$GITHUB_ENV"
|
||||||
- uses: https://gitea.scubbo.org/scubbo/commit-report-sync@main
|
echo
|
||||||
|
echo "from braces"
|
||||||
|
echo "${{ env.REPO_NAME }}"
|
||||||
|
echo "$REPO_NAME"
|
||||||
|
|
||||||
|
- name: Import Secrets
|
||||||
|
id: import-secrets
|
||||||
|
uses: hashicorp/vault-action@v2
|
||||||
|
with:
|
||||||
|
url: http://vault.avril
|
||||||
|
method: kubernetes
|
||||||
|
role: act-runner-helm-charts
|
||||||
|
secrets: |
|
||||||
|
github/token?org_name=${{ gitea.repository_owner }} token | GITHUB_TOKEN ;
|
||||||
|
|
||||||
|
- name: Commit Report Sync
|
||||||
|
uses: https://gitea.scubbo.org/scubbo/commit-report-sync@main
|
||||||
with:
|
with:
|
||||||
target_repo_domain: github.com
|
target_repo_domain: github.com
|
||||||
target_repo_owner: scubbo
|
target_repo_owner: scubbo
|
||||||
target_repo_name: gitea-commit-mirror
|
target_repo_name: gitea-commit-mirror
|
||||||
source_repo_domain: gitea.scubbo.org
|
source_repo_domain: gitea.scubbo.org
|
||||||
source_repo_owner: scubbo
|
source_repo_owner: ${{ github.repository_owner }}
|
||||||
source_repo_name: blogcontent
|
source_repo_name: ${{ env.REPO_NAME }}
|
||||||
token_for_target_repo: ${{ secrets.PAT_FOR_GITHUB_SYNC }}
|
token_for_target_repo: ${{ steps.import-secrets.outputs.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Revoke GitHub token
|
||||||
|
run: |
|
||||||
|
curl -H "Authorization: Bearer ${{ env.GITHUB_TOKEN }}" -X DELETE https://api.github.com/installation/token
|
||||||
|
Loading…
x
Reference in New Issue
Block a user