Skip to content

Commit fd0bf37

Browse files
committed
Workflows
1 parent 5604245 commit fd0bf37

8 files changed

Lines changed: 81 additions & 40 deletions

.github/workflows/branch-cleanup.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@ permissions:
1212
contents: write
1313
pull-requests: read
1414

15+
env:
16+
PLUGIN_SLUG: optimizations-ace-mc
17+
1518
jobs:
1619
cleanup:
1720
runs-on: ubuntu-latest
1821

1922
steps:
20-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
23+
- uses: actions/checkout@v6
2124
with:
2225
fetch-depth: 0
2326
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/issue-management.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ permissions:
1515
pull-requests: write
1616
issues: write
1717

18+
env:
19+
PLUGIN_SLUG: optimizations-ace-mc
20+
1821
jobs:
1922
triage:
2023
runs-on: ubuntu-latest

.github/workflows/new-issue.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ permissions:
1313
contents: read
1414
issues: write
1515

16+
env:
17+
PLUGIN_SLUG: optimizations-ace-mc
18+
1619
jobs:
1720
guide:
1821
runs-on: ubuntu-latest
1922
steps:
2023
- name: Post guidance comment
21-
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5
24+
uses: peter-evans/create-or-update-comment@v5
2225
with:
2326
issue-number: ${{ github.event.issue.number }}
2427
body: |

.github/workflows/new-pull-request.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ on:
1414

1515
permissions: read-all
1616

17+
env:
18+
PLUGIN_SLUG: optimizations-ace-mc
19+
1720
jobs:
1821
guide:
1922
runs-on: ubuntu-latest
@@ -22,7 +25,7 @@ jobs:
2225
pull-requests: write
2326
steps:
2427
- name: Post guidance comment on new PR
25-
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5
28+
uses: peter-evans/create-or-update-comment@v5
2629
with:
2730
issue-number: ${{ github.event.pull_request.number }}
2831
body: |

.github/workflows/release.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,22 @@ on:
1010
permissions:
1111
contents: write
1212

13+
env:
14+
PLUGIN_SLUG: optimizations-ace-mc
15+
1316
jobs:
1417
check-and-release:
1518
runs-on: ubuntu-latest
16-
env:
17-
PLUGIN_FILE: optimizations-ace-mc.php
18-
PLUGIN_SLUG: optimizations-ace-mc
1919
steps:
2020
- name: Checkout code
21-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
21+
uses: actions/checkout@v6
2222
with:
2323
fetch-depth: 0
2424

2525
- name: Get latest version
2626
id: get_version
2727
run: |
28+
PLUGIN_FILE="${PLUGIN_SLUG}.php"
2829
VERSION=$(grep -oP "Version: \K[0-9]+\.[0-9]+\.[0-9]+" "$PLUGIN_FILE")
2930
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
3031
echo "Found version: $VERSION"
@@ -78,6 +79,7 @@ jobs:
7879
- name: Create zip file
7980
if: steps.check_release.outputs.exists == 'false'
8081
run: |
82+
PLUGIN_FILE="${PLUGIN_SLUG}.php"
8183
rm -rf "$PLUGIN_SLUG"
8284
mkdir -p "$PLUGIN_SLUG"
8385
cp "$PLUGIN_FILE" "$PLUGIN_SLUG/"
@@ -105,7 +107,7 @@ jobs:
105107
106108
- name: Create Release
107109
if: steps.check_release.outputs.exists == 'false'
108-
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3
110+
uses: softprops/action-gh-release@v3
109111
with:
110112
tag_name: v${{ steps.get_version.outputs.version }}
111113
name: Release v${{ steps.get_version.outputs.version }}

.github/workflows/update-pot-file.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ permissions:
1313

1414
env:
1515
PLUGIN_SLUG: optimizations-ace-mc
16-
POT_FILE: languages/optimizations-ace-mc.pot
1716

1817
jobs:
1918
update-pot:
@@ -22,12 +21,12 @@ jobs:
2221

2322
steps:
2423
- name: Checkout code
25-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
24+
uses: actions/checkout@v6
2625
with:
2726
fetch-depth: 0
2827

2928
- name: Setup PHP
30-
uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # v2
29+
uses: shivammathur/setup-php@v2
3130
with:
3231
php-version: '8.2'
3332
coverage: none
@@ -40,6 +39,7 @@ jobs:
4039
4140
- name: Regenerate .pot file
4241
run: |
42+
POT_FILE="languages/${PLUGIN_SLUG}.pot"
4343
mkdir -p "$(dirname "$POT_FILE")"
4444
4545
wp i18n make-pot . "$POT_FILE" \
@@ -53,6 +53,8 @@ jobs:
5353
- name: Check for changes
5454
id: changes
5555
run: |
56+
POT_FILE="languages/${PLUGIN_SLUG}.pot"
57+
5658
if git diff --quiet --ignore-matching-lines='^"POT-Creation-Date:' -- "$POT_FILE"; then
5759
echo "has_changes=false" >> "$GITHUB_OUTPUT"
5860
echo "Translation file is up to date"
@@ -69,7 +71,7 @@ jobs:
6971
7072
- name: Create Pull Request
7173
if: steps.changes.outputs.has_changes == 'true'
72-
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8
74+
uses: peter-evans/create-pull-request@v8
7375
with:
7476
commit-message: 'chore(i18n): regenerate translation template'
7577
title: 'chore(i18n): Update translation template (.pot file)'
@@ -90,7 +92,7 @@ jobs:
9092
9193
---
9294
*This PR was automatically generated by the [Update Translation File](https://github.com/${{ github.repository }}/blob/main/.github/workflows/update-pot-file.yml) workflow.*
93-
add-paths: ${{ env.POT_FILE }}
95+
add-paths: languages/${{ env.PLUGIN_SLUG }}.pot
9496
branch: chore/update-pot-file
9597
base: main
9698
delete-branch: true

.github/workflows/wordpress-tested-up-to.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ permissions:
1717
contents: write
1818
pull-requests: write
1919

20+
env:
21+
PLUGIN_SLUG: optimizations-ace-mc
22+
2023
jobs:
2124
tested-up-to:
2225
name: Update Tested Up To Metadata
@@ -53,7 +56,7 @@ jobs:
5356
5457
- name: Create Pull Request
5558
if: steps.changes.outputs.has_changes == 'true'
56-
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8
59+
uses: peter-evans/create-pull-request@v8
5760
with:
5861
commit-message: 'chore: update WordPress Tested up to metadata'
5962
title: 'chore: Update WordPress Tested up to metadata'

0 commit comments

Comments
 (0)