Skip to content

chore: resolve comments #61

chore: resolve comments

chore: resolve comments #61

name: Update HederaResponseCodes.sol
on:
workflow_dispatch:
push:
jobs:
parse-and-update-hedera-response-codes:
name: Make HederaResponseCodes up-to-date with the latest protobufs
runs-on: smart-contracts-linux-large
steps:
- name: Harden Runner
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
- name: Use Node.js [20]
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: 20
- name: Install Dependencies
run: npm install
- name: Install Foundry
uses: step-security/foundry-toolchain@01e2d127ea061e2ce8fa34340de71ca8518f093e # v1.2.1
with:
version: nightly
- name: Parse and update response codes
run: node scripts/hedera-response-codes-protobuf-parser.js
- name: Compile the contracts
run: npx hardhat compile
- name: Import GPG Key
id: gpg_importer
uses: step-security/ghaction-import-gpg@6c8fe4d0126a59d57c21f87c9ae5dd3451fa3cca # v6.1.0
with:
git_commit_gpgsign: true
git_tag_gpgsign: true
git_user_signingkey: true
gpg_private_key: ${{ secrets.GPG_KEY_CONTENTS }}
passphrase: ${{ secrets.GPG_KEY_PASSPHRASE }}
- name: Install jq
run: sudo apt-get install jq
- name: Fetch and set the milestone as env variable
run: |
echo "PR_MILESTONE=$(curl -s https://api.github.com/repos/hashgraph/hedera-smart-contracts/milestones | jq '.'[0].number)" >> $GITHUB_ENV
- name: Create Pull Request Target hedera-smart-contracts Repository
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
with:
branch: HederaResponseCodes-Periodical-Update/${{ github.run_id }}
commit-message: 'chore: update HederaResponseContract.sol with the latest protobufs'
committer: ${{ steps.gpg_importer.outputs.name }} <${{ steps.gpg_importer.outputs.email }}>
add-paths: contracts/system-contracts/HederaResponseCodes.sol
author: ${{ steps.gpg_importer.outputs.name }} <${{ steps.gpg_importer.outputs.email }}>
token: ${{ secrets.GH_ACCESS_TOKEN }}
delete-branch: true
signoff: true
milestone: ${{ env.PR_MILESTONE }}
title: 'chore: update HederaResponseContract.sol with the latest protobufs'
body: >
**Description**: <br><br>
This PR fetches the latest hedera response codes from [hedera-services:main/hapi/hedera-protobufs/services/response_code.proto](https://github.com/hashgraph/hedera-services/blob/main/hapi/hedera-protobufs/services/response_code.proto) and put them into `HederaResponseCodes.sol` contract.
labels: 'internal'
assignees: 'swirlds-automation'