A GitHub action for publishing a message to a Google Cloud Pub/Sub topic.
Authentication to the Google Cloud Platform must first be established with the google-github-actions/auth action.
The service account used for authentication must have sufficient
permissions to publish messages on a Pub/Sub topic. You might wish to
attribute the Pub/Sub Editor (pubsub.editor
) role to it, preferably at
the topic-level rather than at the project-level.
name: Publish to Pub/Sub
...
jobs:
publish-message:
runs-on: ubuntu-latest
steps:
- id: auth
name: Authenticate to Google Cloud Platform
uses: google-github-actions/auth@v0
with:
...
- id: publish
name: Publish a message to Google Cloud Pub/Sub
uses: miraliumre/actions-pubsub@v1
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
topic_name: 'github-actions'
message: 'Hello world!'
Name | Required | Description | Default |
---|---|---|---|
project_id | Yes | The project ID registered with Google Cloud | None |
topic_name | Yes | The name of the topic the message will be published to | None |
message | Yes | The contents of the message to be published | None |
encoding | No | The message string encoding | "utf8" |
The actions-pubsub source code as provided on the src/main.js file is licensed under The Unlicense.
The files under the dist directory are automatically generated by @vercel/ncc from the source code of all dependencies of actions-pubsub, which are subject to different terms. Details of each dependency included and their respective licenses can be found on the dist/licenses.txt file.