Skip to content

Commit 443fd14

Browse files
authored
fix cron action (#19)
* yq * test: step selector. * test: index * test: selector * step id * release v2 * value * fix compare.
1 parent e864bed commit 443fd14

File tree

6 files changed

+20
-13
lines changed

6 files changed

+20
-13
lines changed

.github/workflows/_fetch.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"workflow_call": {
55
"outputs": {
66
"deno_version": {
7-
"value": "${{jobs.job.outputs.deno_version}}"
7+
"value": "${{jobs.job.outputs.value}}"
88
}
99
}
1010
}
@@ -14,12 +14,12 @@
1414
"name": "deno version",
1515
"runs-on": "ubuntu-latest",
1616
"outputs": {
17-
"deno_version": "${{steps.step.outputs.deno_version}}"
17+
"value": "${{steps.step.outputs.value}}"
1818
},
1919
"steps": [{
2020
"id": "step",
2121
"name": "fetch deno latest version",
22-
"run": "echo deno_version=$(curl -Ls https://api.github.com/repos/denoland/deno/releases/latest | yq '.tag_name') >> ${{github.output}}"
22+
"run": "echo value=$(curl -Ls https://api.github.com/repos/denoland/deno/releases/latest | yq -o y '.tag_name') >> ${{github.output}}"
2323
}]
2424
}
2525
}

.github/workflows/_fetch.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ on:
33
workflow_call:
44
outputs:
55
deno_version:
6-
value: ${{jobs.job.outputs.deno_version}}
6+
value: ${{jobs.job.outputs.value}}
77
jobs:
88
job:
99
name: deno version
1010
runs-on: ubuntu-latest
1111
outputs:
12-
deno_version: ${{steps.step.outputs.deno_version}}
12+
value: ${{steps.step.outputs.value}}
1313
steps:
1414
- id: step
1515
name: fetch deno latest version
16-
run: echo deno_version=$(curl -Ls https://api.github.com/repos/denoland/deno/releases/latest | yq '.tag_name') >> ${{github.output}}
16+
run: echo value=$(curl -Ls https://api.github.com/repos/denoland/deno/releases/latest | yq -o y '.tag_name') >> ${{github.output}}

.github/workflows/cron.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,18 @@
1010
"uses": "./.github/workflows/_fetch.yaml"
1111
},
1212
"compare": {
13-
"name": "compare",
13+
"name": "compare version",
1414
"runs-on": "ubuntu-latest",
15+
"outputs": {
16+
"deno_latest": "${{steps.step.outputs.value}}"
17+
},
1518
"needs": [
1619
"fetch"
1720
],
1821
"steps": [{
22+
"id": "step",
1923
"name": "compare dockerhub tag and deno latest version",
20-
"run": "echo deno_latest=$(curl -Ls https://registry.hub.docker.com/v2/repositories/dojyorin/deno/tags?page_size=100 | yq '.results[].name' | grep -q ${{needs.fetch.outputs.deno_version}}; echo ${?}) >> ${{github.output}}"
24+
"run": "echo value=$(curl -Ls https://registry.hub.docker.com/v2/repositories/dojyorin/deno/tags?page_size=100 | yq -o y '.results[].name' | grep -q ${{needs.fetch.outputs.deno_version}}; echo ${?}) >> ${{github.output}}"
2125
}]
2226
},
2327
"test": {

.github/workflows/cron.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@ jobs:
66
fetch:
77
uses: ./.github/workflows/_fetch.yaml
88
compare:
9-
name: compare
9+
name: compare version
1010
runs-on: ubuntu-latest
11+
outputs:
12+
deno_latest: ${{steps.step.outputs.value}}
1113
needs:
1214
- fetch
1315
steps:
14-
- name: compare dockerhub tag and deno latest version
15-
run: echo deno_latest=$(curl -Ls https://registry.hub.docker.com/v2/repositories/dojyorin/deno/tags?page_size=100 | yq '.results[].name' | grep -q ${{needs.fetch.outputs.deno_version}}; echo ${?}) >> ${{github.output}}
16+
- id: step
17+
name: compare dockerhub tag and deno latest version
18+
run: echo value=$(curl -Ls https://registry.hub.docker.com/v2/repositories/dojyorin/deno/tags?page_size=100 | yq -o y '.results[].name' | grep -q ${{needs.fetch.outputs.deno_version}}; echo ${?}) >> ${{github.output}}
1619
test:
1720
if: ${{needs.compare.outputs.deno_latest == 1}}
1821
uses: ./.github/workflows/_test.yaml

.github/workflows/release.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"uses": "actions/checkout@v4"
1515
}, {
1616
"name": "dispatch release",
17-
"uses": "softprops/action-gh-release@v1",
17+
"uses": "softprops/action-gh-release@v2",
1818
"with": {
1919
"generate_release_notes": true
2020
}

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- name: clone repository
1111
uses: actions/checkout@v4
1212
- name: dispatch release
13-
uses: softprops/action-gh-release@v1
13+
uses: softprops/action-gh-release@v2
1414
with:
1515
generate_release_notes: true
1616
fetch:

0 commit comments

Comments
 (0)