Skip to content

Duplicate Issue to Dev Dashboard #84

Duplicate Issue to Dev Dashboard

Duplicate Issue to Dev Dashboard #84

name: Duplicate Issue to Dev Dashboard
on:
issues:
types: [opened]
jobs:
duplicate_issue:
name: duplicate_issue
runs-on: ubuntu-latest
steps:
- 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: Generate Private Issue
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//['"']/'\"'}
gh issue --repo chain4travel/camino-private-issues \
create --title "$TITLE" --body "$BODY" --assignee "mikrub" --label "Public Issue"
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}