generated from MichinaoShimizu/workflow-time-report
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
43 lines (38 loc) · 1.28 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Workflow Time Report
author: MichinaoShimizu
description: Create a report on `Billable Time` in new ISSUE.
outputs:
markdown:
description: Markdown Report
value: ${{ steps.markdown.outputs.stdout }}
runs:
using: composite
steps:
- name: Generate markdown text
id: markdown
shell: bash
run: |
data=$(bash $GITHUB_ACTION_PATH/report.sh)
data="${data//$'\n'/\\n}"
echo "::set-output name=stdout::$data"
env:
GH_TOKEN: ${{ github.token }}
TARGET_REPOSITORY: ${{ github.repository }}
- name: Write job summary
shell: bash
run: echo -e "${{ steps.markdown.outputs.stdout }}" >> $GITHUB_STEP_SUMMARY
- name: Set current date as env variable
shell: bash
if: always()
run: echo "NOW=$(date +'%Y-%m')" >> $GITHUB_ENV
- name: Create issue and label
shell: bash
run: |
gh label create "workflow-time-report" -R ${{ github.repository }} --color 000000 -f
gh issue create -R ${{ github.repository }} --label "${{ env.LABEL }}" --body "$(echo -e "${{ steps.markdown.outputs.stdout }}")" --title "Workflow Time Report ${{ env.NOW }}"
env:
GH_TOKEN: ${{ github.token }}
LABEL: workflow-time-report
branding:
icon: "sun"
color: "orange"