Skip to content

Commit

Permalink
fix: fix yml
Browse files Browse the repository at this point in the history
  • Loading branch information
yoonhyejin committed Sep 25, 2024
1 parent df62bc1 commit 41737e0
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions .github/workflows/contributor-card.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: PR Merge Comment

on:
pull_request:
# types: [closed]
types: [opened]

jobs:
Expand All @@ -17,26 +16,18 @@ jobs:
formatted_username=$(echo "${{ github.event.pull_request.user.login }}" | tr '[:upper:]' '[:lower:]' | sed 's/ /-/g')
echo "FORMATTED_USERNAME=$formatted_username" >> $GITHUB_ENV
- name: Download image
run: |
curl -o downloaded_image.png https://example.com/path/to/image.png
- name: Create Comment
uses: actions/github-script@v6
with:
script: |
const { github, context } = require('@actions/github');
const prUser = process.env.FORMATTED_USERNAME;
const url = `https://datahub-contributor-cards.vercel.app/${prUser}`;
const body = `![Image](downloaded_image.png)\n\n@${prUser} Thank you for opening a pull request!\nVisit your page here: [${url}](${url})`;
github.rest.issues.createComment({
...context.repo,
// Create a comment on the PR
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
body: body
});
# - name: Upload image to comment
# uses: actions/upload-artifact@v3
# with:
# name: downloaded_image
# path: downloaded_image.png

0 comments on commit 41737e0

Please sign in to comment.