arddluma / cloudflare-pages-slack-notification Goto Github PK
View Code? Open in Web Editor NEWGitHub Action for CloudFlare Pages Slack notifications
Home Page: https://ardd.cloud/setup-cloudflare-pages-slack-notifications
License: MIT License
GitHub Action for CloudFlare Pages Slack notifications
Home Page: https://ardd.cloud/setup-cloudflare-pages-slack-notifications
License: MIT License
Hi,
First of all thank you for this action! Much better than waiting on Cloudflare to support hooks for sure 😄
For context: I'm running Cloudflare pages builds not just on push but also via API deployments.
I tried running this action via workflow_dispatch (https://docs.github.com/en/rest/actions/workflows#create-a-workflow-dispatch-event) on master ({"ref": "refs/heads/master"}
) but I get the following after the deploy step:
Waiting for Pages to finish building...
(node:1616) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
# Now at stage: build
# Now at stage: deploy
/home/runner/work/_actions/arddluma/cloudflare-pages-slack-notification/v2.5/dist/action.js:[12](https://github.com/allfront/allfront-marketing-new/actions/runs/3372632941/jobs/5596288290#step:3:13)823
Commit: ${import_utils.context.payload.head_commit.url}
^
TypeError: Cannot read properties of undefined (reading 'url')
at run (/home/runner/work/_actions/arddluma/cloudflare-pages-slack-notification/v2.5/dist/action.js:12823:52)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Describe the bug
When a deployment is "skipped" by cloudflare, the action continuously runs indefinitely.
GitHub Action yml config
name: Send Slack notifications
on:
push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Send Slack deployment notifications
uses: arddluma/[email protected]
with:
accountEmail: ${{ secrets.CF_ACCOUNT_EMAIL }}
apiKey: ${{ secrets.CF_API_KEY }}
accountId: ${{ secrets.CF_ACC_ID }}
project: ${{ secrets.CF_PROJECT }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
slackWebHook: ${{ secrets.SLACK_WEBHOOK }}
Expected behavior
I would expect the action step to be cancelled.
Describe the bug
The action properly waits until the CF Pages build finishes but then shows "no_service".
GitHub Action yml config
name: Deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Await Cloudflare Pages build and send Slack notification
uses: arddluma/[email protected]
with:
accountEmail: ${{ secrets.CLOUDFLARE_ACCOUNT_EMAIL }}
apiKey: ${{ secrets.CLOUDFLARE_API_KEY }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
project: uplink-docs
githubToken: ${{ secrets.GITHUB_TOKEN }}
slackWebHook: ${{ secrets.SLACK_WEBHOOK_URL }}
Expected behavior
A success message
Describe the bug
When using this action, this warning appears:
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: arddluma/cloudflare-pages-slack-notification@v4. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Expected behavior
The action should not cause this warning to appear, by way of using Node 20.
Additional context
https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/
Hello @arddluma - Great work on you CF pages slack notification action
I found an issue when using the action - Its throwing error everytime when the last state is build
and it is never been success.
Here's the configurations on my yml
file
trigger-slack-notification:
runs-on: ubuntu-latest
needs: deploy
steps:
- name: Await CF Pages and send Slack notification
uses: arddluma/cloudflare-pages-slack-notification@v2
with:
accountEmail: ${{ secrets.CF_ACCOUNT_EMAIL }}
apiKey: ${{ secrets.CF_API_KEY }}
accountId: ${{ secrets.CF_ACC_ID }}
project: ${{ secrets.CF_PAGES_PROJECT }}
slackWebHook: ${{ secrets.SLACK_WEBHOOK_URL }}
Is there anything that I missed on the configuration? Is this something that you noticed?
Hello @arddluma
The package return these kind of warnings
Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. Please update the following actions to use Node.js 16: arddluma/cloudflare-pages-slack-notification
The set-output
command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Seems like need to update @action/core
to the latest version actions/setup-node#590 actions/setup-node#589
In addition of email + api key it would be nice if one could use cloudflare api token to limit the scope one gives access to.
Is it possible to make slack messages optional? For example, we have already messages from github in our slack, but we need development env/status for PRs, github also sends messages about it to slack so a separate message is not required. But the main issue is when I delete Slack token from the action it throws an error
Hi there,
I'm wondering if it's possible to wait for the deployment of a specific branch or environment.
Let met explain:
I have the main branch (prod) and the staging branch (staging). CF Pages deploys automatically on every commit within those branches. In my GitHub workflow I'm waiting for the deployment to be done thx to this plugin. When the deploy is done from the main branch (so in production environment), I'm sending a notif to a "production" Slack channel. And when the deploy is done from the staging branch (so in "preview" environment wrt CF terminology), I'm sending a notif to a "staging" Slack channel.
The problem is, since the plugin waits for any build to be complete and the builds often run in parallel, the notifications are sometimes sent to the wrong Slack channel, ie prod notifications to the staging channel and vice versa.
If I could specify for which branch I want to wait for the build being complete, it would solve my issue. Alternatively it would also work if I can tell the plugin to wait for a build in the "production" env to be complete vs the "preview" env.
Is there a way to achieve this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.