forked from jozu-ai/kitops
-
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.
- Loading branch information
1 parent
f75a6a3
commit baa04a8
Showing
1 changed file
with
74 additions
and
0 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,74 @@ | ||
name: Permissions Testing | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
skip_signing: | ||
description: 'Skip code signing' | ||
required: true | ||
default: false | ||
type: boolean | ||
release_tag: | ||
description: 'Release tag' | ||
required: true | ||
type: string | ||
push: | ||
tags: | ||
- 'v*' | ||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
INIT_IMAGE_NAME: ${{ github.repository }}-init | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
packages: write | ||
id-token: write | ||
attestations: write | ||
|
||
jobs: | ||
test-permissions: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# checkout the homebrew-kitops repository (jozu-ai/homebrew-kitops) | ||
- name: Checkout homebrew-kitops | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
with: | ||
###### CHANGE THIS TO jozu-ai/homebrew-kitops ###### | ||
repository: brett-hodges/homebrew-kitops | ||
ref: 'main' | ||
path: homebrew-kitops | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: List dirs after checkout homebrew-kitops | ||
run: | | ||
ls | ||
- name: List contents of homebrew-kitops | ||
run: | | ||
shopt -s failglob | ||
pushd homebrew-kitops | ||
ls | ||
popd | ||
- name: Commit Homebrew Formula to Tap | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
TAG_NAME: ${{ inputs.release_tag}} | ||
##### CHANGE REPO TO jozu-ai/homebrew-kitops | ||
REPO: "brett-hodges/homebrew-kitops" | ||
run: | | ||
pushd homebrew-kitops | ||
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||
PR_BRANCH="${{ github.ref_name }}-homebrew-tap-update" | ||
git fetch origin main | ||
git branch "$PR_BRANCH" | ||
git checkout "$PR_BRANCH" | ||
git pull origin --ff-only "${PR_BRANCH}" || true | ||
git config --global user.name "${GITHUB_ACTOR}" | ||
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com" | ||
git add --all | ||
git commit -m "homebrew: update Homebrew Tap Formula for ${{ github.ref_name }}" | ||
git push origin "${PR_BRANCH}" | ||
gh pr create --fill --base main --head "${PR_BRANCH}" | ||
git checkout "${CURRENT_BRANCH}" | ||
popd |