Correct chart y-axis docs (#4163) #236
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Bump Plugins Submodule | |
on: | |
push: | |
branches: | |
- main | |
concurrency: | |
# Wait for in-progress runs of this action to finish before starting. | |
# This has a double-purpose: It ensures that caches are always able to pick | |
# up work from previous builds of the same branch, and it rate-limits the CI | |
# to ensure it's running smoothly for all users. | |
group: ${{ github.workflow }} | |
jobs: | |
bump-plugins-submodule: | |
name: Bump the plugins submodule if necessary | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Configure ssh-agent | |
uses: webfactory/ssh-agent@v0.9.0 | |
with: | |
ssh-private-key: ${{ secrets.TENZIR_PLUGINS_DEPLOY_KEY }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
persist-credentials: false | |
- name: Generate a token | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
id: generate_token | |
uses: actions/create-github-app-token@v1 | |
with: | |
app-id: ${{ vars.TENZIR_AUTOBUMPER_APP_ID }} | |
private-key: ${{ secrets.TENZIR_AUTOBUMPER_APP_PRIVATE_KEY }} | |
owner: ${{ github.repository_owner }} | |
- uses: crazy-max/ghaction-import-gpg@v6 | |
with: | |
gpg_private_key: ${{ secrets.TENZIR_BOT_GPG_SIGNING_KEY }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
- name: Bump plugins submodule | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
env: | |
GITHUB_APP_TOKEN: ${{ steps.generate_token.outputs.token }} | |
GH_TOKEN: ${{ steps.generate_token.outputs.token }} | |
run: | | |
set -x | |
# Setup git | |
git config --global user.name 'tenzir-bot' | |
git config --global user.email 'engineering@tenzir.com' | |
git remote set-url origin https://x-access-token:$GITHUB_APP_TOKEN@github.com/tenzir/tenzir.git | |
git -C contrib/tenzir-plugins fetch -q origin main | |
plugins_sha=$(git -C contrib/tenzir-plugins rev-parse HEAD) | |
plugins_sha_short=$(git -C contrib/tenzir-plugins rev-parse --short HEAD) | |
plugins_main_sha=$(git -C contrib/tenzir-plugins rev-parse origin/main) | |
plugins_main_sha_short=$(git -C contrib/tenzir-plugins rev-parse --short origin/main) | |
if [ "$plugins_sha" != "$plugins_main_sha" ]; then | |
# Auto-merge the plugins PR and update 'tenzir-plugins/main'. | |
# gh pr --repo tenzir/tenzir-plugins list | |
pr_number=$(gh pr --repo tenzir/tenzir-plugins list --search $plugins_sha --json number -q .[0].number) | |
[ $pr_number ] # Assert the pr number was non-empty | |
gh pr --repo tenzir/tenzir-plugins merge $pr_number --admin --merge --match-head-commit ${plugins_sha} | |
# Fetch and checkout the newly created merge commit | |
git -C contrib/tenzir-plugins pull -q origin main | |
# Create a new commit for the updated submodule. | |
new_plugins_main_sha=$(git -C contrib/tenzir-plugins rev-parse --short origin/main) | |
nix/update-plugins.sh | |
git add contrib/tenzir-plugins | |
git add nix/ | |
git commit -m "Bump submodule from $plugins_sha_short to $new_plugins_main_sha" | |
git push -u origin main | |
fi |