Skip to content

Commit 67e6a71

Browse files
authored
refactor: move updater to a subdir (#33)
* refactor: move updater to subfolder * refactor: update workflows * chore: move updater tests * chore: fix updater workflow test
1 parent e4cbd60 commit 67e6a71

24 files changed

Lines changed: 12 additions & 12 deletions

.github/workflows/script-tests.yml renamed to .github/workflows/updater-scripts-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@v3
1212
- run: make test
13+
working-directory: updater

.github/workflows/workflow-tests.yml renamed to .github/workflows/updater-workflow-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
create-pr:
99
uses: ./.github/workflows/updater.yml
1010
with:
11-
path: tests/sentry-cli.properties
11+
path: updater/tests/sentry-cli.properties
1212
name: CLI
1313
pattern: '^2\.0\.'
1414
pr-strategy: update
@@ -19,7 +19,7 @@ jobs:
1919
test-args:
2020
uses: ./.github/workflows/updater.yml
2121
with:
22-
path: tests/workflow-args.sh
22+
path: updater/tests/workflow-args.sh
2323
name: Workflow args test script
2424
runs-on: macos-latest
2525
pattern: '.*'
@@ -37,7 +37,7 @@ jobs:
3737
- run: "[[ '${{ needs.create-pr.outputs.originalTag }}' == '2.0.0' ]]"
3838
- run: "[[ '${{ needs.create-pr.outputs.latestTag }}' =~ ^[0-9.]+$ ]]"
3939
- run: "[[ '${{ needs.create-pr.outputs.prUrl }}' =~ ^https://github.com/getsentry/github-workflows/pull/[0-9]+$ ]]"
40-
- run: "[[ '${{ needs.create-pr.outputs.prBranch }}' == 'deps/tests/sentry-cli.properties' ]]"
40+
- run: "[[ '${{ needs.create-pr.outputs.prBranch }}' == 'deps/updater/tests/sentry-cli.properties' ]]"
4141

4242
- run: "[[ '${{ needs.test-args.outputs.baseBranch }}' == '' ]]"
4343
- run: "[[ '${{ needs.test-args.outputs.originalTag }}' == 'latest' ]]"

.github/workflows/updater.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ jobs:
116116
117117
- name: Update to the latest version
118118
id: target
119-
run: ${{ runner.temp }}/ghwf/scripts/update-dependency.ps1 -Path '${{ inputs.path }}' -Pattern '${{ inputs.pattern }}'
119+
run: ${{ runner.temp }}/ghwf/updater/scripts/update-dependency.ps1 -Path '${{ inputs.path }}' -Pattern '${{ inputs.pattern }}'
120120

121121
- name: Get the base repo info
122122
if: steps.target.outputs.latestTag != steps.target.outputs.originalTag
@@ -175,11 +175,11 @@ jobs:
175175
- name: Get target changelog
176176
if: steps.target.outputs.latestTag != steps.target.outputs.originalTag
177177
run: |
178-
$changelog = ${{ runner.temp }}/ghwf/scripts/get-changelog.ps1 `
178+
$changelog = ${{ runner.temp }}/ghwf/updater/scripts/get-changelog.ps1 `
179179
-RepoUrl '${{ steps.target.outputs.url }}' `
180180
-OldTag '${{ steps.target.outputs.originalTag }}' `
181181
-NewTag '${{ steps.target.outputs.latestTag }}'
182-
${{ runner.temp }}/ghwf/scripts/set-github-env.ps1 TARGET_CHANGELOG $changelog
182+
${{ runner.temp }}/ghwf/updater/scripts/set-github-env.ps1 TARGET_CHANGELOG $changelog
183183
184184
# First we create a PR only if it doesn't exist. We will later overwrite the content with the same action.
185185
- name: Create a PR
@@ -228,12 +228,12 @@ jobs:
228228

229229
- name: 'After new PR: redo the update'
230230
if: ${{ ( steps.target.outputs.latestTag != steps.target.outputs.originalTag ) && ( steps.existing-pr.outputs.url == '') }}
231-
run: ${{ runner.temp }}/ghwf/scripts/update-dependency.ps1 -Path '${{ inputs.path }}' -Tag '${{ steps.target.outputs.latestTag }}'
231+
run: ${{ runner.temp }}/ghwf/updater/scripts/update-dependency.ps1 -Path '${{ inputs.path }}' -Tag '${{ steps.target.outputs.latestTag }}'
232232

233233
- name: Update Changelog
234234
if: steps.target.outputs.latestTag != steps.target.outputs.originalTag
235235
run: |
236-
${{ runner.temp }}/ghwf/scripts/update-changelog.ps1 `
236+
${{ runner.temp }}/ghwf/updater/scripts/update-changelog.ps1 `
237237
-Name '${{ inputs.name }}' `
238238
-PR '${{ steps.pr.outputs.url }}' `
239239
-RepoUrl '${{ steps.target.outputs.url }}' `

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
secrets:
3939
api-token: ${{ secrets.CI_DEPLOY_KEY }}
4040

41-
# Update using a custom shell script, see scripts/update-dependency.ps1 for the required arguments
41+
# Update using a custom shell script, see updater/scripts/update-dependency.ps1 for the required arguments
4242
agp:
4343
uses: getsentry/github-workflows/.github/workflows/updater.yml@v2
4444
with:
@@ -70,9 +70,8 @@ jobs:
7070
* default: ubuntu-latest
7171
* `pr-strategy`: How to handle PRs.
7272
Can be either of the following:
73-
* `create` (default) - create a new PR for new dependency versions as they are released - maintainers may merge or close older PRs manually
74-
* `update` - keep a single PR that gets updated with new dependency versions until merged - only the latest version update is available at any time
75-
73+
* `create` (default) - create a new PR for new dependency versions as they are released - maintainers may merge or close older PRs manually
74+
* `update` - keep a single PR that gets updated with new dependency versions until merged - only the latest version update is available at any time
7675

7776
### Secrets
7877

File renamed without changes.

0 commit comments

Comments
 (0)