This action sends a message to an AWS SNS Topic to trigger a composer update workflow in each bedrock.
Required The repo that triggers the action.
Required The REF that triggers the action, it could be refs/heads/dev
or *.*.*
.
Required AWS Access Key Id from the dev and staging environment
Required AWS Access Key from the dev and staging environment.
Required ARN of the AWS SNS Topic to publish for the dev repositories.
Required ARN of the AWS SNS Topic to publish for the staging repositories.
All Bedrock repos should contain two workflows:
trigger-bedrock-updates.yml
: This workflow is triggered by a AWS Lambda Function. It runs thecomposer update
command and open a pull request to thedefault
branch.auto-merge.yml
: This workflow is triggered by theautoupdate.yml
workflow. It merges the pull request to thetarget
branch.
Those workflows would use reusable workflows to avoid duplication.
See: Pressbooks Reusable Workflows for more information.
All plugin repos should contain a step that triggers the composer-autoupdate-bedrock
action, this step will publish a message to an AWS SNS Topic to trigger the update process in all bedrock repos.
This step should be added as one of the last steps in the *.yml
workflow that contains tests, code coverage, etc...
The AWS ACCESS Token should have the permission to publish to the SNS Topics.
if: github.ref == 'refs/heads/dev' it's used to avoid triggering the action in other branches for example this would trigger only when the dev branch is updated.
jobs:
# other tasks... like linting, testing, etc.
trigger_bedrock_updates:
if: github.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
steps:
- name: Trigger Bedrock Composer Update
uses: pressbooks/composer-autoupdate-bedrock@main
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_SNS_ARN_DEV: ${{ secrets.AWS_SQS_ARN_DEV }}
AWS_SNS_ARN_STAGING: ${{ secrets.AWS_SQS_ARN_STAGING }}
INPUT_TRIGGERED_BY: ${{ github.repository }}
REF: ${{ github.ref }}
In order to submit a new version of this action, you need to create a new tag in the format vX
and push it to the repository or update an existing tag.
You should compile the code before pushing the tag, to do that you need to run the following command:
ncc build index.js --license licenses.txt
This will create a new folder called dist
with the compiled code bundling node_modules dependencies.
git commit -m "feat: new version"
git tag -a -m "feat: feature description" v1
git push --follow-tags
uses: pressbooks/composer-autoupdate-bedrock@vX
or if always using the latest version
uses: pressbooks/composer-autoupdate-bedrock@main