diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml new file mode 100644 index 0000000000..8a3dd4d91b --- /dev/null +++ b/.github/workflows/labels.yml @@ -0,0 +1,45 @@ +name: label PRs + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + auto-label: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Check for changes and set labels + id: check_changes + run: | + LABELS="" + + if git diff --name-only origin/main...HEAD | grep -q '^relayer/'; then + LABELS="${LABELS}Component: Relayer," + fi + if git diff --name-only origin/main...HEAD | grep -q '^contracts/'; then + LABELS="${LABELS}Component: Ethereum," + fi + if git diff --name-only origin/main...HEAD | grep -q '^web/'; then + LABELS="${LABELS}Component: Web," + fi + if git diff --name-only origin/main...HEAD | grep -q '^docs/'; then + LABELS="${LABELS}Component: Docs," + fi + if git diff --name-only origin/main...HEAD | grep -q '^smoketest/'; then + LABELS="${LABELS}Component: Smoke Tests," + fi + if git diff --name-only origin/main...HEAD | grep -q '^control/'; then + LABELS="${LABELS}Component: Control Tool," + fi + + echo "labels=${LABELS%,}" >> $GITHUB_ENV + + - name: Add labels to PR + if: env.labels != '' + uses: actions-ecosystem/action-add-labels@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + labels: ${{ env.labels }} diff --git a/relayer/README.md b/relayer/README.md index 9616997262..a617925081 100644 --- a/relayer/README.md +++ b/relayer/README.md @@ -136,3 +136,5 @@ As we can see it will cost 0.041163771 DOT as transaction fee and the reward is For Parachain message relayer take [transaction]( https://dashboard.tenderly.co/snowfork/snowbridge-polkadot/tx/1/0x2dbcf28f8d80c43acd3f08e15b0ec2e3c2c8a929d50e0cba2e3bba5d39738bce) for example: As we can see it will cost 0.000628 ETH as transaction fee and the reward is 0.000942 ETH, so it's about 0.0003 ETH as incentive for each message. + +### Test labels