Merge branch 'main' into feat/notify-console #5
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: Create Issue On Release | ||
on: | ||
release: | ||
types: [created] | ||
jobs: | ||
create-issue: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create Issue | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ secrets.DOCS_PAT }} # Assuming 'PAT' is your Personal Access Token stored as a secret | ||
script: | | ||
const issueTitle = `A new release ${context.payload.release.tag_name} just cut for ${context.payload.repository.name}.`; | ||
const issueBody = `Please check the api docs for compatibility with the release. Here is the [link to release notes](${context.payload.release.html_url}).`; | ||
const labels = ['triage', 'priority-1-blocker', 'documentation']; | ||
const issue = await github.rest.issues.create({ | ||
owner: 'TBD54566975', | ||
repo: 'developer.tbd.website', | ||
title: issueTitle, | ||
body: issueBody, | ||
labels: labels | ||
}); | ||
return { issueNumber: issue.data.number, releaseTag: context.payload.release.tag_name, repo: context.payload.repository.name }; | ||
- name: Notify Discord | ||
uses: Ilshidur/[email protected] | ||
env: | ||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | ||
with: | ||
args: "A new release {{ EVENT_PAYLOAD.release.tag_name }} of project {{ EVENT_PAYLOAD.repository.name }} has been cut. Please check the release notes: {{ EVENT_PAYLOAD.release.html_url }} for compatibility with docs." | ||
name: Create Issue in SSI Console | ||
on: | ||
push: | ||
branches: [ main ] | ||
jobs: | ||
create_issue: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
steps: | ||
- name: Create issue in SSI Console | ||
run: | | ||
curl --request POST \ | ||
--url https://api.github.com/repos/TBD54566975/ssi-console/issues \ | ||
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ | ||
--header 'content-type: application/json' \ | ||
--data '{ | ||
"title": "Automated issue for commit: ${{ github.sha }} from SSI Service", | ||
"body": "This issue was automatically created by the GitHub Action workflow **${{ github.workflow }}**. \n\n The commit hash was: _${{ github.sha }}_." | ||
}' \ | ||
--fail |