Skip to content
Open
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
62 changes: 36 additions & 26 deletions .github/workflows/stargazer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name: Stargazer


on:
pull_request:
types:
- closed
push

env:
OPTIMISM_RPC: ${{secrets.OPTIMISM_RPC}}
Expand All @@ -13,43 +11,55 @@ env:

# Excuse the terrible bash code.
jobs:
# check:
# strategy:
# fail-fast: true
if_merged:
if: github.event.pull_request.merged == true
check:
strategy:
fail-fast: true
# if_merged:
# if: github.event.pull_request.merged == true
name: Stargazer project
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- uses: jwalton/gh-find-current-pr@v1
id: findPr
with:
# Can be "open", "closed", or "all". Defaults to "open".
state: closed
# This will echo "Your PR is 7", or be skipped if there is no current PR.
- run: echo "Your PR is ${PR}" && echo "body is ${body}"

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
# - name: Update Impact score
- name: Update Impact score
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
run: |
export STARGAZER_CONTRACT=0x2084DC12810Ad13e7606f5248EC5E05a390A8Dfd;
export additions=${{toJSON(github.event.pull_request.additions)}};
export deletions=${{toJSON(github.event.pull_request.deletions)}};
if [$additions -eq null]
then
export additions=0;
fi
if [$deletions -eq null]
then
export additions=0;
fi
export contributor=$(echo "Commit body ${{toJSON(github.event.pull_request.body)}}" | grep -o -E '0x.{0,40}');
echo $additions && echo $deletions && echo $contributor;
cast send $STARGAZER_CONTRACT "updateUnits(string,address,uint128)" "stargazer" $contributor $additions --private-key $PRIVATE_KEY --rpc-url $OPTIMISM_RPC;
# - name: Update Impact score
# # if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
# run: |
# echo "${{toJSON(github.event)}}";







# export STARGAZER_CONTRACT=0x2084DC12810Ad13e7606f5248EC5E05a390A8Dfd;
# export additions=${{toJSON(github.event.pull_request.additions)}};
# export deletions=${{toJSON(github.event.pull_request.deletions)}};
# if [$additions -eq null]
# then
# export additions=0;
# fi
# if [$deletions -eq null]
# then
# export additions=0;
# fi
# export contributor=$(echo "Commit body ${{toJSON(github.event.pull_request.body)}}" | grep -o -E '0x.{0,40}');
# echo $additions && echo $deletions && echo $contributor;
# cast send $STARGAZER_CONTRACT "updateUnits(string,address,uint128)" "stargazer" $contributor $additions --private-key $PRIVATE_KEY --rpc-url $OPTIMISM_RPC;

# echo "${{toJSON(github.event.pull_request.labels)}}" ;
# - name: Contract interaction
Expand Down