Skip to content

Commit e4cbd60

Browse files
authored
ci: fix workflow tests (#31)
* ci: fix workflow tests * test: fix update-dependency.ps1 test
1 parent ae76c03 commit e4cbd60

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

.github/workflows/workflow-tests.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
path: tests/workflow-args.sh
2323
name: Workflow args test script
2424
runs-on: macos-latest
25+
pattern: '.*'
2526
_workflow_version: ${{ github.sha }}
2627
secrets:
2728
api-token: ${{ github.token }}
@@ -39,7 +40,7 @@ jobs:
3940
- run: "[[ '${{ needs.create-pr.outputs.prBranch }}' == 'deps/tests/sentry-cli.properties' ]]"
4041

4142
- run: "[[ '${{ needs.test-args.outputs.baseBranch }}' == '' ]]"
42-
- run: "[[ '${{ needs.test-args.outputs.originalTag }}' == 'v2' ]]"
43-
- run: "[[ '${{ needs.test-args.outputs.latestTag }}' == 'v2' ]]"
43+
- run: "[[ '${{ needs.test-args.outputs.originalTag }}' == 'latest' ]]"
44+
- run: "[[ '${{ needs.test-args.outputs.latestTag }}' == 'latest' ]]"
4445
- run: "[[ '${{ needs.test-args.outputs.prUrl }}' == '' ]]"
4546
- run: "[[ '${{ needs.test-args.outputs.prBranch }}' == '' ]]"

tests/update-dependency.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ if (-not (Test-Path $testDir))
1818
}
1919

2020
$repoUrl = 'https://github.com/getsentry/github-workflows'
21-
$currentVersion = 'v2' # Note: this will change once there's a new tag in this repo
21+
22+
# Find the latest latest version in this repo. We're intentionally using different code than `update-dependency.ps1`
23+
# script uses to be able to catch issues, if any.
24+
$currentVersion = (git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' $repoUrl `
25+
| Select-Object -Last 1 | Select-String -Pattern 'refs/tags/(.*)$').Matches.Groups[1].Value
2226

2327
RunTest "properties-file" {
2428
$testFile = "$testDir/test.properties"

tests/workflow-args.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -euo pipefail
55

66
case $1 in
77
get-version)
8-
echo "v2"
8+
echo "latest"
99

1010
# Run actual tests here.
1111
if [[ "$(uname)" != 'Darwin' ]]; then

0 commit comments

Comments
 (0)