Skip to content

Commit 473def9

Browse files
authored
fix: auto fpm formula update (#44)
2 parents 709dd82 + 0cd0da4 commit 473def9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/fpm-version-update.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,18 @@ jobs:
2828
- name: Extract current formula version
2929
id: get-current-version
3030
run: |
31-
CURRENT_VERSION="$(grep -oP 'url "https://github.com/fortran-lang/fpm/releases/download/v\K[0-9.]+' Formula/fpm.rb)"
31+
CURRENT_VERSION="$(grep -oP 'url "https://github.com/fortran-lang/fpm/releases/download/v\K[0-9.]+' Formula/fpm.rb | head -n 1)"
3232
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> "$GITHUB_ENV"
3333
echo "Current version: ${CURRENT_VERSION}"
3434
3535
- name: Compare versions
3636
id: check-update
3737
run: |
38-
if [ "${LATEST_VERSION}" != "${CURRENT_VERSION}" ]; then
38+
if [ "${LATEST_VERSION}" != "${CURRENT_VERSION}" ] || [ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]; then
3939
echo "New version available!"
4040
echo "UPDATE_NEEDED=true" >> "$GITHUB_ENV"
4141
else
42+
echo "UPDATE_NEEDED=false" >> "$GITHUB_ENV"
4243
echo "No update needed."
4344
fi
4445
@@ -80,7 +81,7 @@ jobs:
8081
- name: Create Pull Request
8182
if: env.UPDATE_NEEDED == 'true'
8283
id: create-pr
83-
uses: peter-evans/create-pull-request@v5
84+
uses: peter-evans/create-pull-request@v6
8485
with:
8586
token: ${{ secrets.GITHUB_TOKEN }}
8687
commit-message: "Update fpm to ${{ env.LATEST_VERSION }}"

0 commit comments

Comments
 (0)