Comments (7)
Ours (created by @jasikpark) is slightly more complicated, but the same idea. It comments right away at the start of the workflow, then updates it when complete. And each push to the PR updates the comment, rather than leaving a new one.
steps:
- name: Comment deploy start
if: github.event_name != 'push'
uses: mshick/add-pr-comment@v2
with:
message-id: cloudflare-deploy
message: |
### <span aria-hidden="true">🚧</span> Deploy Preview building...
| Name | Link |
|---------------------------------|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | ${{ github.sha }} |
|<span aria-hidden="true">🔍</span> Latest deploy log | ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |
---
- ... rest of config
- name: Comment deploy url
uses: mshick/add-pr-comment@v2
with:
message-id: cloudflare-deploy
message: |
### <span aria-hidden="true">✅</span> Deploy Preview ready!
| Name | Link |
|---------------------------------|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | ${{ github.sha }} |
|<span aria-hidden="true">🔍</span> Latest deploy log | ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |
|<span aria-hidden="true">😎</span> Deploy Preview Url | [${{ steps.cloudflare.outputs.url }}](${{ steps.cloudflare.outputs.url }}) |
|<span aria-hidden="true">🌳</span> Environment | ${{ steps.cloudflare.outputs.environment }} |
---
We'd love to also include the alias, but it seems that is still broken in the pages-action (#29)
from pages-action.
just to point out
you need to add permissions.pull-requests: write
in your deploy step
e.g:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
pull-requests: write
I guess we could add this info about the comment into the README.md
, what do you think?
from pages-action.
we are doing like this
- name: Publish to Cloudflare Pages
id: cloudflare-publish
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: page
directory: public
# Optional: Enable this if you want to have GitHub Deployments triggered
#gitHubToken: ${{ secrets.GITHUB_TOKEN }}
- uses: mshick/add-pr-comment@v2
with:
message: |
🚀 This branch can be previewed at ${{ steps.cloudflare-publish.outputs.url }}
from pages-action.
Does anyone have a workaround or custom steps they've added to comment the deployment URL back to the PR, until/unless this becomes a built-in feature?
from pages-action.
We ended up using mshick/add-pr-comment@v2
, but it sure would be nice if the action did this for us.
from pages-action.
can you share what you did with mshick/add-pr-comment@v2 ?
from pages-action.
@nprogers I see you closed this as completed. Does that mean this action is not being deprecated, and additional features are being added? I'm a bit confused as to the status of this tool.
from pages-action.
Related Issues (20)
- how can I set a service binding via this action? HOT 1
- Post-upload fails HOT 3
- Unable to publish site, API return 503 and 504 errors HOT 1
- Disable Wrangler
- Specifying `--compatibility-flags` HOT 2
- Action fails after Deployment complete! HOT 2
- GitHub Actions failing on run
- Deploying with cloudflare/pages-action but cannot locate sveltekit build directory HOT 2
- Update README GITHUB_TOKEN to DEPLOY_TOKEN HOT 1
- Authentication Error 10000 on endpoint /upload-token HOT 1
- Trunk based development and differentiating preview vs production env
- Project not found. The specified project name does not match any of your existing projects. HOT 1
- Transitioning from Node 16 to Node 20 HOT 26
- Impossible to set branch deployment options with this action? HOT 1
- Incorrect alias HOT 3
- "No deployment available" when deploying with this action HOT 1
- Failed runs-on windows-latest with node 18/20. But node 16 works fine.
- Using CF_PAGES_URL HOT 2
- Is this repository deprecated, unmaintained ? HOT 5
- How can I automatically post the preview address as a comment?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pages-action.