Skip to content

Commit

Permalink
fixing pr commenting step
Browse files Browse the repository at this point in the history
  • Loading branch information
flowstate committed Nov 6, 2024
1 parent abfc210 commit 34ebc53
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,12 @@ jobs:

- name: Comment on PR
uses: actions/github-script@v7
env:
VERSION: ${{ env.VERSION }}
with:
script: |
const version = process.env.VERSION;
const prNumber = context.payload.pull_request.number;
const comment = `
🚀 Preview package published!
Expand All @@ -73,15 +76,16 @@ jobs:
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple socketsecurity==${version}
\`\`\`
Docker image: \`socketdev/cli:pr-${context.issue.number}\`
Docker image: \`socketdev/cli:pr-${prNumber}\`
`;
github.rest.issues.createComment({
issue_number: context.issue.number,
issue_number: prNumber,
owner: context.repo.owner,
repo: context.repo.name,
body: comment
})
});
- name: Login to Docker Hub
uses: docker/login-action@v3
Expand All @@ -91,6 +95,8 @@ jobs:

- name: Build & Push Docker Preview
uses: docker/build-push-action@v5
env:
VERSION: ${{ env.VERSION }}
with:
push: true
tags: socketdev/cli:pr-${{ github.event.pull_request.number }}
Expand Down

0 comments on commit 34ebc53

Please sign in to comment.