Skip to content

Duplicate Issue to Dev Dashboard #60

Duplicate Issue to Dev Dashboard

Duplicate Issue to Dev Dashboard #60

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 }}