Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(BACK-7982): add workflow to format descriptors #90

Merged
merged 3 commits into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
name: 🤖 format descriptors

on:
schedule:
- cron: '0 7 * * *'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
BRANCH: "master"

jobs:
format:
name: format descriptors
runs-on: public-ledgerhq-shared-small
timeout-minutes: 60
steps:

- name: Checkout
timeout-minutes: 10
uses: actions/checkout@v4

- name: Get date
timeout-minutes: 10
run: echo "CURRENT_DATE=$(date +"%Y-%m-%d %H:%M")" >> $GITHUB_ENV

- name: Setup python
timeout-minutes: 10
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'

- name: Login to Ledger JFrog
timeout-minutes: 10
uses: LedgerHQ/actions-security/actions/jfrog-login@actions/jfrog-login-1

- name: Setup pip
timeout-minutes: 10
run: jf pipc --global --repo-resolve=virtual-pypi-prod-green

- name: Install ERC-7730 library
timeout-minutes: 10
run: jf pip install erc7730

- name: Format ERC-7730 descriptors
timeout-minutes: 10
run: erc7730 format

- name: Check changes
id: changes
timeout-minutes: 10
shell: bash
run: |
[[ -n "$(git status -s)" ]] && echo "changes=true" >> $GITHUB_OUTPUT || true

- name: Open pull request
if: ${{ !cancelled() && steps.changes.outputs.changes == 'true' }}
timeout-minutes: 10
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.CI_BOT_TOKEN }}
author: ${{ secrets.CI_BOT_USERNAME }} <${{ secrets.CI_BOT_USERNAME }}@users.noreply.github.com>
branch: ${{ env.BRANCH }}-format-descriptors
base: ${{ env.BRANCH }}
delete-branch: false
commit-message: 'chore: format descriptors - ${{ env.CURRENT_DATE }}'
title: 'chore: format descriptors - ${{ env.CURRENT_DATE }}'
body: ${{ steps.submodules.outputs.prBody }}
draft: false
signoff: false