Skip to content

Commit

Permalink
Add error message
Browse files Browse the repository at this point in the history
  • Loading branch information
eerison committed Mar 27, 2023
1 parent 5c83fea commit 2e0097a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
1 change: 0 additions & 1 deletion .github/workflows/discussion-comment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
with:
organization: 'shield-wall'
repository: 'myprofile'
# discussionId: ${{inputs.php_versions}}
discussionId: ${{inputs.discussionId}}
body: ${{inputs.body}}

34 changes: 28 additions & 6 deletions .github/workflows/resume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
runs-on: ubuntu-latest
name: Generate pdf
if: github.event_name == 'discussion' || github.event.label.name == 'template'
outputs:
parse-yaml: ${{ steps.parse-yaml.outputs }}
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
Expand All @@ -42,7 +44,8 @@ jobs:
with:
path: ./data/data.txt
contents: ${{github.event.discussion.body}}
- run: |
- id: parse-yaml
run: |
npm run node:generate:data
npm run lint:check:yaml
if: github.event_name == 'discussion'
Expand All @@ -68,12 +71,31 @@ jobs:
CLOUDFLARE_ACCOUNT_ID: ${{secrets.CLOUDFLARE_ACCOUNT_ID}}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}

discussion-comment-final:
discussion-comment-success:
uses: shield-wall/myprofile/.github/workflows/discussion-comment.yaml@master
if: github.event_name == 'discussion'
# if: github.event_name == 'discussion'
if: needs.resume.result == 'success'
needs: resume
with:
discussionId: ${{github.event.discussion.number}}
# discussionId: ${{github.event.discussion.number}}
discussionId: 723
body: |
Your resume was processed with success :tada: :tada:
Resume link: https://bucket.myprofile.pro/users/${{github.actor}}/resume.pdf
:white_check_mark: Your resume was generated with success :tada: :tada:, you can access using the link bellow.
**:page_with_curl: https://bucket.myprofile.pro/users/${{github.actor}}/resume.pdf**
discussion-comment-failure:
uses: shield-wall/myprofile/.github/workflows/discussion-comment.yaml@master
# if: github.event_name == 'discussion'
if: ${{ always() }} && needs.resume.result == 'failure'
needs: resume
with:
# discussionId: ${{github.event.discussion.number}}
discussionId: 723
body: |
:x: :bangbang: We couldn't generate your resume :disappointed_relieved: , we found out this issue related with your **yaml syntax**.
Please fix the **issue** bellow and after that **edit your discussion's description** to try again :arrows_clockwise: :wink:
:point_down: :point_down:
```bash
${{needs.resume.outputs.parse-yaml}}
```
2 changes: 1 addition & 1 deletion data/data.yaml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ sectionTwo:
#[education section]
- title: Education
icon: education
children:
children:
- degree: Master of Arts
institution: Harvard
timePeriod: March 2012 - December 2013
Expand Down

0 comments on commit 2e0097a

Please sign in to comment.