Duplicate Issue to Dev Dashboard #60
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: Duplicate Issue to Dev Dashboard | |
on: | |
issues: | |
types: [opened] | |
jobs: | |
duplicate_issue: | |
name: duplicate_issue | |
runs-on: ubuntu-latest | |
steps: | |
- name: Prepare Title and Body | |
id: issue-params | |
run: | | |
cat > issue.md<<- 'EOM' | |
${{ github.event.issue.body }} | |
--- | |
This issue is related to public issue: | |
* https://github.com/chain4travel/camino-public-issues/issues/${{ github.event.issue.number }} | |
EOM | |
ISSUE_BODY=$(cat issue.md) | |
cat > title.md<<- EOM | |
${{ github.event.issue.title }} | |
EOM | |
TITLE=$(cat title.md) | |
BODY=${ISSUE_BODY//['"']/'\"'} | |
echo "title=$TITLE" >> $GITHUB_OUTPUT | |
echo "body=$BODY" >> $GITHUB_OUTPUT | |
- name: Generate a token | |
id: generate-token | |
uses: actions/create-github-app-token@v1 | |
with: | |
app-id: ${{ vars.ISSUES_ACTIONS_APP_ID }} | |
private-key: ${{ secrets.GIT_PRIVATE_ISSUES_APP_PK }} | |
repositories: "camino-private-issues" | |
- name: Create Private Issue | |
run: | | |
gh issue --repo chain4travel/camino-private-issues \ | |
create --title "${{ steps.issue-params.outputs.title }}" --body "${{ steps.issue-params.outputs.body }}" --assignee "mikrub" --label "Public Issue" | |
env: | |
GH_TOKEN: ${{ steps.generate-token.outputs.token }} |