Skip to content

Duplicate Issue to Dev Dashboard #75

Duplicate Issue to Dev Dashboard

Duplicate Issue to Dev Dashboard #75

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
export TITLE=$(cat title.md)
export BODY=${ISSUE_BODY//['"']/'\"'}
echo "issue_title<<'EOM'" >> $GITHUB_OUTPUT
echo "$TITLE" >> $GITHUB_OUTPUT
echo "EOM" >> $GITHUB_OUTPUT
echo "issue_body<<'EOM'" >> $GITHUB_OUTPUT
echo "$BODY" >> $GITHUB_OUTPUT
echo "EOM" >> $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.issue_title }}" --body "${{ steps.issue-params.outputs.issue_body }}" --assignee "mikrub" --label "Public Issue"
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}