Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: first test
Browse files Browse the repository at this point in the history
nicolasbrugneaux committed Jan 30, 2024
1 parent 6b2e34c commit e9a6401
Showing 2 changed files with 81 additions and 5 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/open-docs-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
name: Open a pull-request on the celo-org/docs repository

on:
workflow_call:
inputs:
commit:
description: 'Commit of the developer-tooling repo that the submodule will be updated to'
type: string
required: true

workflow_dispatch:
push:
branches:
- ci/update-celo-docs

jobs:
open-docs-pr:
name: Prepare or Publish
# TODO: ask the correct runner for this workflow
runs-on: ['self-hosted', 'org', '8-cpu']
# TODO: ask correct permissions
permissions:
contents: write
id-token: write
pull-requests: write
repository-projects: write
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Open pull-request
run: |
COMMIT=${{ inputs.commit }}
REPOSITORY="nicolasbrugneaux/celo-docs"
BRANCH_NAME="ci/${{ github.run_id }}-${{ github.run_attempt }}"
# Clone the remote repository
git clone \
--depth=1 \
--branch=main \
https://github.com/$REPOSITORY docs
cd docs
# Setup the committers identity.
# TODO: ask security for a bot account
git config user.email "nicolas.brugneaux@clabs.co"
git config user.name "Nicolas Brugneaux"
# Create a new feature branch for the changes.
git checkout -b $BRANCH_NAME
cd submodule/developer-tooling
git checkout $COMMIT
cd ..
git add .
git commit -m "chore: update developer-tooling submodule"
git push origin $BRANCH_NAME
echo "${{ secrets.ACCESS_TOKEN }}" > token.txt
gh auth login --with-token < token.txt
gh pr create \
--body "__I was created by a bot beep boop__" \
--title "chore: update developer-tooling submodule to $COMMIT" \
--head "$BRANCH_NAME" \
--base "main"
18 changes: 13 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -18,14 +18,15 @@ jobs:
id-token: write
pull-requests: write
repository-projects: write
outputs:
publishedPackages: ${{ steps.changesets.outputs.publishedPackages }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Akeyless Get Secrets
id: get_auth_token
uses:
docker://us-west1-docker.pkg.dev/devopsre/akeyless-public/akeyless-action:latest
uses: docker://us-west1-docker.pkg.dev/devopsre/akeyless-public/akeyless-action:latest
with:
api-url: https://api.gateway.akeyless.celo-networks-dev.org
access-id: p-kf9vjzruht6l
@@ -34,8 +35,8 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 18.x
- name: "enable corepack for yarn"
run : sudo corepack enable yarn
- name: 'enable corepack for yarn'
run: sudo corepack enable yarn
shell: bash
# must call twice because of chicken and egg problem with yarn and node
- uses: actions/setup-node@v4
@@ -54,4 +55,11 @@ jobs:
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn release
version: yarn version-and-reinstall
version: yarn version-and-reinstall

open-docs-pr:
needs: release
if: ${{ contains(fromJson(needs.release.outputs.publishedPackages).*.name, '@celo/cli') }}
uses: celo-org/developer-tooling/.github/workflows/open-docs-pr.yml@ci/update-celo-docs
with:
commit: ${{ github.ref_name }}

0 comments on commit e9a6401

Please sign in to comment.