Skip to content

Commit

Permalink
Fix trying to push to main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
StrangeRanger committed Dec 20, 2024
1 parent 7f96853 commit f29f2bd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/update-from-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
workflows: ["Update From Submodule"]
types:
- completed
workflow_dispatch:

permissions:
contents: write
Expand All @@ -18,14 +17,15 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Check out the branch from the triggering workflow
ref: ${{ github.event.workflow_run.head_branch }}
submodules: true

- name: Validate branch
- name: Validate repository
run: |
BRANCH_NAME="${{ github.ref_name }}"
echo "Branch: $BRANCH_NAME"
if [[ "$BRANCH_NAME" != "main" ]]; then
echo "Not on main branch. Exiting."
REPO_NAME="${{ github.event.workflow_run.head_repository.full_name }}"
if [[ $REPO_NAME != "${{ github.repository }}" ]]; then
echo "Untrusted repository detected! Exiting."
exit 1
fi
Expand Down

0 comments on commit f29f2bd

Please sign in to comment.