Skip to content

Fixes to merge#676

Closed
jjavieralv wants to merge 30 commits intodevelopfrom
fixes-to-merge
Closed

Fixes to merge#676
jjavieralv wants to merge 30 commits intodevelopfrom
fixes-to-merge

Conversation

@jjavieralv
Copy link
Copy Markdown
Contributor

Description

Please include a summary of the change and be sure you follow the contributions rules we do provide here

Task ID: OS-?

Type of change

See the framework lifecycle in packages/contracts/docs/framework-lifecycle to decide what kind of change this pull request is.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I have selected the correct base branch.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.
  • I ran all tests with success and extended them if necessary.
  • I have updated the CHANGELOG.md file in the root folder.
  • I have updated the DEPLOYMENT_CHECKLIST file in the root folder.
  • I have updated the UPDATE_CHECKLIST file in the root folder.
  • I have created a follow-up task to update the Developer Portal with the changes made in this PR.

Rekard0 and others added 30 commits February 4, 2025 20:57
* Preparing the ABI package for NPM

* Removing the redundant rollup config

* Yarn.lock update

* Updated package.json definition

* Minor edit

* Ingoring NPM postinstall scripts

* Scaffolding the addresses file

* Exporting artifacts with a deprecation warning

* Amending the readme using the intended  import usage

* Prepopulating the upgradeable protocol contracts

* Minor edit

* Adding the existing PSP addresses (v1.3)

* Version edit

* Improved readme

* Minor edit

* Minor edit

* Adding PUB_PINATA_JWT to .env.example

* add artifacts publish github flow

* Adding a placeholder for Pinata JWT in .env.example

* add alpha

* Removing a non relevant command on contract-tests.yml

---------

Co-authored-by: Rekard0 <[email protected]>
* running test against Agung Testnet

* fix typo

* testing deployment

* create standard json

* deploy against localhost fork of peaq

* uncoment test fork

* add batches

* add placeholder

* add peaq rpc

* move place holder to framework

* Clean up hardhat configs and networks

* keep Root permision for the deployer

* add peaq verification api

* remove batches used for Agung

* remove fork testing

* Clean up and comments
* cd: remove subgraph

* add empty line

* Update yarn lock
* feat: add proposals data folder to gitIgnore

* feat: create script to merge the json actions

* feat: add update path in the hh config file

* feat: create the proposal creation call information to the script

* feat: use the actions descriptions as proposal metadatat

* feat: add logic to stor the metadata on ipfs and set the cid on the proposal data

* feat: add proposal information to the json generated

* feat: update the script to get the proposal information properly from the generated json

* feat: add direction regarding how to use the script

* feat: add format when storing info in json

* feat: set the proposal end date in the future

* feat: add test to check new deployment proposal is correct

* fix typo

* fix: un mark generate proposal json as async

* fix: revert if something went wrong when generating the jsons

* feat: validate json has all the needed info

* fix: revert if something when wrong generating the calldata

* fix: revert

* fix: typo

* fix: throw if something went wrong

* feat(wip): add function to check all stages after proposal execution

* feat: add check for the permission and plugin and framework state after the proposal is executed

* feat: store the json to avoid losing the deployed addresses

* fix: update ignored folder to the new one

* feat: add folder for the script and related files

* fix: update script path and test paths, add filter for identifying each plugin index on the array

* fix: uncomment function call

* fix: revert messages and add check for creating the file

* feat: add readme describing how using the script

* fix: modify upload to pinata function call to new one

* feat: bump sdk version

* update copy

* update the enddate

* Fixing the local test

* add conditional skip test

* don't require pinata in testing

* add comment

---------

Co-authored-by: Rekard0 <[email protected]>
Co-authored-by: Jør∂¡ <[email protected]>
* ci:update hardhat configs

* fix:prettier
* add linea and mode

* Update packages/contracts/networks.ts

---------

Co-authored-by: Jør∂¡ <[email protected]>
* Adding optimism artifacts

* Version
Comment on lines +11 to +66
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org/'

- name: Configure NPM for Scoped Package
run: |
cd packages/artifacts
SCOPE=$(jq -r '.name' package.json | cut -d'/' -f1)
echo "$SCOPE:registry=https://registry.npmjs.org/" > ~/.npmrc
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc

- name: Get Version from package.json
id: get_version
run: |
cd packages/artifacts
VERSION=$(jq -r '.version' package.json)
TAG_VERSION="v$VERSION"
echo "VERSION=$TAG_VERSION" >> $GITHUB_ENV

- name: Create Git Tag
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git tag $VERSION
git push origin $VERSION

- name: Install Dependencies
run: |
cd packages/artifacts
yarn install

- name: Build Package
env:
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
run: |
cd packages/artifacts
yarn build

- name: Publish to NPM
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cd packages/artifacts
if [[ "$VERSION" == *"-alpha"* ]]; then
npm publish --tag alpha --access public
else
npm publish --tag latest --access public
fi

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 7 months ago

The workflow must have a top-level permissions key (applies to all jobs) or a job-specific permissions block (applies only to that job), with permissions set only as required. To support git push (as in the "Create Git Tag" step), the job needs contents: write. For publishing to npm, the workflow uses a token provided via secrets.NPM_TOKEN, so that's not affected by GITHUB_TOKEN permissions. A minimal fix is to add permissions: contents: write at the job or workflow level above runs-on. Place this before runs-on in the affected job (publish-artifacts-to-npm).


Suggested changeset 1
.github/workflows/artifacts-publish.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/artifacts-publish.yml b/.github/workflows/artifacts-publish.yml
--- a/.github/workflows/artifacts-publish.yml
+++ b/.github/workflows/artifacts-publish.yml
@@ -8,6 +8,8 @@
 
 jobs:
   publish-artifacts-to-npm:
+    permissions:
+      contents: write
     runs-on: ubuntu-latest
 
     steps:
EOF
@@ -8,6 +8,8 @@

jobs:
publish-artifacts-to-npm:
permissions:
contents: write
runs-on: ubuntu-latest

steps:
Copilot is powered by AI and may make mistakes. Always verify output.
@jjavieralv jjavieralv closed this Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants