From 443015fdbe6ab905b6513a2701ac83b82a25cdea Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Thu, 30 Oct 2025 14:54:06 -0600 Subject: [PATCH 1/5] add dependabot file --- .github/dependabot.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..37b9de0 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: composer + directory: "/" + schedule: + interval: weekly + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: weekly \ No newline at end of file From 378eb36fd50b9f46debe14dd45f5bc8c6b7b43cd Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Thu, 30 Oct 2025 14:54:15 -0600 Subject: [PATCH 2/5] validate the action yml file too --- .github/workflows/lint.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 95a0848..0e027b4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,6 +4,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 + - uses: jazzsequence/github-action-validator@v1 - name: Lint run: shellcheck bin/*.sh \ No newline at end of file From c3a1d43f257100a3831c86d1dea0712b7c58fc51 Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Thu, 30 Oct 2025 15:19:20 -0600 Subject: [PATCH 3/5] add GITHUB_BASE_REF --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 82d2513..5672379 100644 --- a/action.yml +++ b/action.yml @@ -24,7 +24,6 @@ inputs: branch: description: The branch to use as the base for PRs and commit the changes back to. required: false - default: 'main' pr-status: description: The status of the PR to create. Default is 'draft'. Accepts 'draft' or 'open'. required: false @@ -50,5 +49,6 @@ runs: FILENAMES: ${{ inputs.filenames }} BRANCH: ${{ inputs.branch }} PR_STATUS: ${{ inputs.pr-status }} + GITHUB_BASE_REF: ${{ github.base_ref }} run: bash ${{ github.action_path }}/bin/validate-plugin-version.sh \ No newline at end of file From 7968ed2ac844f4717d848709bc0896fbd393b10d Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Thu, 30 Oct 2025 15:20:23 -0600 Subject: [PATCH 4/5] improve default branch detection in GitHub Actions The `git remote show origin` command can be unreliable for determining the default branch in some CI environments, particularly for pull requests from forks. This change updates the validation script to prioritize the `GITHUB_BASE_REF` environment variable when it is available. This provides a more robust method for identifying the target branch within a GitHub Actions workflow. Additionally, the script is modified to skip the branch checkout logic when running in a PR context, as the correct branch is already checked out by the workflow. --- bin/validate-plugin-version.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/validate-plugin-version.sh b/bin/validate-plugin-version.sh index 62bf413..6c450f4 100644 --- a/bin/validate-plugin-version.sh +++ b/bin/validate-plugin-version.sh @@ -3,12 +3,15 @@ set -euo pipefail IFS=$'\n\t' main() { - # Determine the default branch - DEFAULT_BRANCH=$(git remote show origin | grep 'HEAD branch' | cut -d' ' -f5) + if [[ -n "${GITHUB_BASE_REF:-}" ]]; then + DEFAULT_BRANCH="${GITHUB_BASE_REF}" + else + DEFAULT_BRANCH=$(git remote show origin | grep 'HEAD branch' | cut -d' ' -f5) + fi echo "Default branch is $DEFAULT_BRANCH" # Check out the specified branch if $BRANCH is set and not already on it - if [[ -n "${BRANCH:-}" && "$(git rev-parse --abbrev-ref HEAD)" != "$BRANCH" ]]; then + if [[ -z "${GITHUB_BASE_REF:-}" && -n "${BRANCH:-}" && "$(git rev-parse --abbrev-ref HEAD)" != "$BRANCH" ]]; then echo "Checking if branch $BRANCH exists." if ! git show-ref --verify --quiet "refs/heads/$BRANCH"; then if git show-ref --verify --quiet "refs/remotes/origin/$BRANCH"; then From c43200a56a1464eaf0cdb1ce9318afe832207225 Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Thu, 30 Oct 2025 15:20:31 -0600 Subject: [PATCH 5/5] update trigger events to include push for plugin version validation --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1dd72f7..e6a3fd9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,5 @@ name: Validate Plugin Version Test -on: [pull_request] +on: [push, pull_request] jobs: test: runs-on: ubuntu-latest