update workflow #57
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check cherry-pick to release every day at 5 at the morning | ||
on: | ||
schedule: | ||
- cron: '0 3 * * *' | ||
workflow_dispatch: | ||
jobs: | ||
jobs: | ||
check_issue: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check for cprelease issue | ||
id: issue | ||
uses: actions/github-script@v3 | ||
with: | ||
script: | | ||
const issues = await github.issues.listForRepo({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
state: 'open', | ||
per_page: 100 | ||
}); | ||
const issue = issues.data.find(issue => issue.title === 'cprelease'); | ||
if (issue) { | ||
return { | ||
user_login: issue.user.login, | ||
issue_number: issue.number, | ||
issue_title: issue.title, | ||
issue_body: issue.body | ||
}; | ||
} else { | ||
return null; | ||
} | ||
result-encoding: string | ||
cherry_pick: | ||
if: steps.issue.outputs.result != null | ||
needs: check_issue | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cherry-pick the issue | ||
uses: untillpro/ci-action/.github/workflows/cp.yml@master | ||
with: | ||
org: 'ivvorg' | ||
repo: 'public-test-repo' | ||
team: 'DevOps_cp' | ||
user: '${{ fromJson(needs.check_issue.outputs.result).user_login }}' | ||
issue: '${{ fromJson(needs.check_issue.outputs.result).issue_number }}' | ||
issue-title: '${{ fromJson(needs.check_issue.outputs.result).issue_title }}' | ||
issue-body: '${{ fromJson(needs.check_issue.outputs.result).issue_body }}' | ||
secrets: | ||
git_token: ${{ secrets.REPOREADING_TOKEN }} |