Renovate 설정을 업데이트합니다. #5726
This file contains hidden or 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: tag-with-comment | |
| on: | |
| issue_comment: | |
| types: | |
| - 'created' | |
| env: | |
| GITHUB_API_URL_BASE: https://api.github.com/repos/${{ github.repository }} | |
| # Node.js | |
| NODE_VERSION: 'lts/*' | |
| PNPM_VERSION: '9' | |
| NPM_REGISTRY_URL: 'https://registry.npmjs.org' | |
| SLACK_GITHUB_REPOSITORY: ${{ github.repository }} | |
| jobs: | |
| tag-with-comment: | |
| if: github.event.issue.state == 'open' && github.event.issue.pull_request && endsWith(github.event.comment.body, 'release-canary') | |
| runs-on: ${{ vars.NOL_RUNNER }} | |
| steps: | |
| - uses: pnpm/action-setup@v3 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| - name: Use Node.js ${{ env.NODE_VERSION }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: ${{ env.NPM_REGISTRY_URL }} | |
| - name: Recognize head SHA of pull request | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.READ_ONLY_NPM_TOKEN }} | |
| run: | | |
| pnpm dlx @titicaca/gha-tools fetch-github-pr ${{ github.event.issue.number }} | |
| PR_SHA=$(cat ./pr.json | jq -r '.head.sha') | |
| PR_REF=$(cat ./pr.json | jq -r '.head.ref') | |
| echo "PR_NUMBER=${{ github.event.issue.number }}" >> $GITHUB_ENV | |
| echo "PR_SHA=$PR_SHA" >> $GITHUB_ENV | |
| echo "PR_REF=$PR_REF" >> $GITHUB_ENV | |
| echo "SLACK_GITHUB_REF=$PR_REF" >> $GITHUB_ENV | |
| echo "PR_SHORT_SHA=${PR_SHA:0:7}" >> $GITHUB_ENV | |
| echo "PR_TITLE=$(cat ./pr.json | jq -r '.title')" >> $GITHUB_ENV | |
| echo "TAG_NAME=release-pr-${{ github.event.issue.number }}" >> $GITHUB_ENV | |
| - name: Leave reaction to comment | |
| run: | | |
| curl \ | |
| --url https://api.github.com/repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions \ | |
| -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
| -H "Accept: application/vnd.github.squirrel-girl-preview+json" \ | |
| -H "Content-Type: application/json" \ | |
| -f --request POST \ | |
| -d "{\"content\":\"+1\"}" | |
| - name: Create tag object | |
| id: create-tag-object | |
| # https://docs.github.com/en/free-pro-team@latest/rest/reference/git#create-a-tag-object | |
| run: | | |
| curl --url $GITHUB_API_URL_BASE/git/tags \ | |
| -f \ | |
| --request POST \ | |
| -H 'Authorization: token ${{ secrets.TRIPLE_BOT_GITHUB_TOKEN }}' \ | |
| -H 'Content-Type: application/json' \ | |
| -d "{\"tag\":\"$TAG_NAME\",\"message\":\"released at \`${{ github.event.updated_at }}\`\",\"object\":\"${PR_SHA}\",\"type\":\"commit\"}" \ | |
| > tag.json | |
| echo "::set-output name=tag-sha::$(node -p -e 'require(`./tag.json`).sha')" | |
| - name: Check tag ref exist | |
| id: check-tag-ref | |
| # https://docs.github.com/en/free-pro-team@latest/rest/reference/git#get-a-reference | |
| run: | | |
| curl --url $GITHUB_API_URL_BASE/git/refs/tags/$TAG_NAME \ | |
| -sI \ | |
| -o /dev/null \ | |
| -w "%{http_code}" \ | |
| -H 'Authorization: token ${{ secrets.TRIPLE_BOT_GITHUB_TOKEN }}' \ | |
| > status | |
| echo "::set-output name=status::$(cat status)" | |
| - name: Create new tag ref | |
| if: ${{ steps.check-tag-ref.outputs.status != '200' }} | |
| env: | |
| TAG_SHA: ${{ steps.create-tag-object.outputs.tag-sha }} | |
| # https://docs.github.com/en/free-pro-team@latest/rest/reference/git#create-a-reference | |
| run: | | |
| curl --url $GITHUB_API_URL_BASE/git/refs \ | |
| -f \ | |
| --request POST \ | |
| -H 'Authorization: token ${{ secrets.TRIPLE_BOT_GITHUB_TOKEN }}' \ | |
| -H 'Content-Type: application/json' \ | |
| -d "{\"ref\":\"refs/tags/$TAG_NAME\",\"sha\":\"$TAG_SHA\"}" | |
| - name: Update tag ref | |
| if: ${{ steps.check-tag-ref.outputs.status == '200' }} | |
| env: | |
| TAG_SHA: ${{ steps.create-tag-object.outputs.tag-sha }} | |
| # https://docs.github.com/en/free-pro-team@latest/rest/reference/git#update-a-reference | |
| run: | | |
| curl --url $GITHUB_API_URL_BASE/git/refs/tags/$TAG_NAME \ | |
| -f \ | |
| --request PATCH \ | |
| -H 'Authorization: token ${{ secrets.TRIPLE_BOT_GITHUB_TOKEN }}' \ | |
| -H 'Content-Type: application/json' \ | |
| -d "{\"force\":true,\"sha\":\"${TAG_SHA}\"}" |