Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
34 changes: 0 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,6 @@ env:
MW_INSTALL_PATH: ${{ github.workspace }}

jobs:
version:
name: Version Bump
runs-on: ubuntu-latest
steps:
- name: Setup Extension
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check override permission
id: override
env:
ACTOR: ${{ github.triggering_actor }}
GH_TOKEN: ${{ github.token }}
REPOSITORY: ${{ github.repository }}
run: |
permission=$(gh api \
--header "X-GitHub-Api-Version: 2022-11-28" \
--jq '.permission' \
"repos/${REPOSITORY}/collaborators/${ACTOR}/permission" 2>/dev/null) || permission="none"
if [[ $permission == admin || $permission == maintain ]]; then
echo "enabled=true" >> "$GITHUB_OUTPUT"
echo "Version check overridden by ${ACTOR} (${permission})."
else
echo "enabled=false" >> "$GITHUB_OUTPUT"
fi
- name: Test version check
run: .github/scripts/check-version-bump.test.sh
- name: Check version bump
if: steps.override.outputs.enabled != 'true'
env:
BASE_REVISION: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
HEAD_REVISION: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
run: .github/scripts/check-version-bump.sh "$BASE_REVISION" "$HEAD_REVISION"

style:
name: Code Style
runs-on: ${{ matrix.os }}
Comment on lines 17 to 20
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Version Check

permissions:
contents: read

on:
push:
branches:
- main
- specialPageList # Add your development branch
Comment thread
jeffw16 marked this conversation as resolved.
Outdated
pull_request_target:

jobs:
version:
name: Version Bump
runs-on: ubuntu-latest
steps:
- name: Setup Extension
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.base.sha || github.sha }}
- name: Fetch pull request revision
if: github.event_name == 'pull_request_target'
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: git fetch --no-tags origin "pull/${PR_NUMBER}/head"
Comment thread
Copilot marked this conversation as resolved.
Outdated
- name: Check override permission
id: override
env:
ACTOR: ${{ github.triggering_actor }}
GH_TOKEN: ${{ github.token }}
REPOSITORY: ${{ github.repository }}
run: |
permission=$(gh api \
--header "X-GitHub-Api-Version: 2022-11-28" \
--jq '.permission' \
"repos/${REPOSITORY}/collaborators/${ACTOR}/permission" 2>/dev/null) || permission="none"
if [[ $permission == admin || $permission == maintain ]]; then
echo "enabled=true" >> "$GITHUB_OUTPUT"
echo "Version check overridden by ${ACTOR} (${permission})."
else
echo "enabled=false" >> "$GITHUB_OUTPUT"
fi
- name: Test version check
run: .github/scripts/check-version-bump.test.sh
- name: Check version bump
if: steps.override.outputs.enabled != 'true'
env:
BASE_REVISION: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.base.sha || github.event.before }}
HEAD_REVISION: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }}
run: .github/scripts/check-version-bump.sh "$BASE_REVISION" "$HEAD_REVISION"
Loading