Jack Jackson 056ae9d058
All checks were successful
Mirror to GitHub / build-and-push (push) Successful in 19s
Gitea Actions Demo / build-and-push (push) Successful in 1m24s
Gitea Actions Demo / update-deployment-repo (push) Successful in 10s
Make revocation curl silent
2025-03-18 22:32:44 -07:00

45 lines
1.5 KiB
YAML

name: Mirror to GitHub
run-name: Mirror to GitHub
on: [push]
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
# It's still _so_ baffling to me that this doesn't appear to be available in the `github` context.
- name: Determine repo name
run: |
echo "Test output"
echo ${{ github.repository }} | cut -d'/' -f2
echo "REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2)" >> "$GITHUB_ENV"
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:
source_repo_domain: gitea.scubbo.org
source_repo_owner: ${{ github.repository_owner }}
source_repo_name: ${{ env.REPO_NAME }}
target_repo_domain: github.com
target_repo_owner: scubbo
target_repo_name: gitea-commit-mirror
token_for_target_repo: ${{ steps.import-secrets.outputs.GITHUB_TOKEN }}
- name: Revoke GitHub token
run: |
curl -s -H "Authorization: Bearer ${{ env.GITHUB_TOKEN }}" -X DELETE https://api.github.com/installation/token
echo "Token revoked"