Files
netlist/.github/workflows/checkout-better-cf-ip.yml
T
2024-01-27 01:18:18 +08:00

46 lines
1.1 KiB
YAML

name: checkout-better-cf-ip
on:
push:
branches:
- 'master'
paths:
- '.github/workflows/checkout-better-cf-ip.yml'
workflow_dispatch:
schedule:
- cron: '0 16 * * *'
jobs:
checkout-better-cf-ip:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check latest release tag
uses: actions/github-script@v7
id: latest_tag
with:
result-encoding: string
retries: 3
script: |
const ret = await github.rest.repos.getLatestRelease({
owner: "XIU2",
repo: "CloudflareSpeedTest"
})
console.log(ret.data.tag_name)
return ret.data.tag_name
- name: Checkout reference branch 1
uses: actions/checkout@v4
with:
repository: XIU2/CloudflareSpeedTest
ref: ${{steps.latest_tag.outputs.result}}
path: ref1
- name: Checkout target branch
uses: actions/checkout@v4
with:
ref: better-cf-ip
path: target
- name: Rebuild target branch
run: |
ls ref1