Skip to content

Commit f667128

Browse files
author
James Amner
authored
Merge pull request #314 from boxuk/BWP-122
[BWP-122] Triggering the Test Workflows
2 parents ad0f0b8 + 0487130 commit f667128

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# WordPress Deps Auto Updater - Checkout
2+
3+
This is a simple GitHub Worklfow to checkout the PR the `boxuk/wp-deps-auto-update` action.
4+
5+
## Usage
6+
7+
You'll need to use the `boxuk/wp-checkout-deps-auto-update` action to setup your workflow if the event is triggered by `workflow_run`. We need the `worfklow_run_id` to pull the relevant PR number.
8+
9+
```yml
10+
# Other config...
11+
on:
12+
pull_request: # For all PRs
13+
workflow_run: # For WP Updates
14+
workflows: ["Update WP Deps"]
15+
types:
16+
- completed
17+
18+
jobs:
19+
test:
20+
runs-on: ubuntu-latest
21+
name: Test
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
if: github.event_name != 'workflow_run'
26+
27+
- name: Checkout
28+
uses: boxuk/wp-checkout-deps-auto-update@main
29+
if: github.event_name == 'workflow_run'
30+
with:
31+
workflow_run_id: ${{ github.event.workflow_run.id }}
32+
33+
# next steps...
34+
```
35+
36+
## Contributing
37+
38+
Please do not submit any Pull Requests here. They will be closed.
39+
---
40+
41+
Please submit your PR here instead: https://github.com/boxuk/wp-packages
42+
43+
This repository is what we call a "subtree split": a read-only subset of that main repository.
44+
We're looking forward to your PR there!

packages/deps-auto-update/readme.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,48 @@ jobs:
2828
uses: 'boxuk/wp-deps-auto-update@main'
2929
with:
3030
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
- name: Save PR number
32+
env:
33+
PR_NUMBER: ${{ steps.update.outputs.pull-request-number }}
34+
run: |
35+
mkdir -p ./pr
36+
echo $PR_NUMBER > ./pr/pr_number
37+
- uses: actions/upload-artifact@v4
38+
with:
39+
name: pr_number
40+
path: pr/
3141
```
3242
43+
This will save the PR number created, so you can use it later for triggering tests etc.
44+
45+
For any other tests etc that you may need to have completed upon creation of this PR, you can then use the `boxuk/wp-checkout-deps-auto-update` action to setup your tests.
46+
47+
```yml
48+
# Other config...
49+
on:
50+
pull_request: # For all PRs
51+
workflow_run: # For WP Updates
52+
workflows: ["Update WP Deps"]
53+
types:
54+
- completed
55+
56+
jobs:
57+
test:
58+
runs-on: ubuntu-latest
59+
name: Test
60+
steps:
61+
- name: Checkout
62+
uses: actions/checkout@v4
63+
if: github.event_name != 'workflow_run'
64+
65+
- name: Checkout
66+
uses: boxuk/wp-checkout-deps-auto-update@main
67+
if: github.event_name == 'workflow_run'
68+
with:
69+
workflow_run_id: ${{ github.event.workflow_run.id }}
70+
71+
# next steps...
72+
```
3373

3474
# Setting up your Project for WP Packages
3575

0 commit comments

Comments
 (0)