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

Extend awards action #1933

Merged
merged 3 commits into from
Mar 1, 2025
Merged

Conversation

Scroogey-SN
Copy link
Contributor

Implements #1849

Adds a github action that is triggered on PR merge events, running a script that finds the relevant PR and associated issue.
It calculates the awards due to the PR and issue authors based on the issue tags and difficulty/priority rules. If needed, it adds lines to awards.csv and opens a PR for this change.

I switched the action trigger to pull_request (instead of push) and added a step 'unfiltered' to echo the event for logging.

Tested with squash and merge.

@huumn huumn merged commit dfc2974 into stackernews:master Mar 1, 2025
6 checks passed
huumn added a commit that referenced this pull request Mar 1, 2025
huumn added a commit that referenced this pull request Mar 1, 2025
@huumn
Copy link
Member

huumn commented Mar 1, 2025

Failed with this error. Looks like it's reading in something it doesn't intend to.

'{
/home/runner/work/_temp/80dd4180-04a2-4245-8af3-82140e8cffed.sh: line 1: useWalletPayment: command not found
/home/runner/work/_temp/80dd4180-04a2-4245-8af3-82140e8cffed.sh: line 1: AnonWalletError: command not found
Traceback (most recent call last):
  File "/home/runner/work/stacker.news/stacker.news/extend-awards.py", line 106, in <module>
    j = json.loads(sys.argv[1])
  File "/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^
  File "/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/json/decoder.py", line 345, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/json/decoder.py", line 361, in raw_decode
    obj, end = self.scan_once(s, idx)
               ~~~~~~~~~~~~~~^^^^^^^^
json.decoder.JSONDecodeError: Unterminated string starting at: line 230 column 15 (char 11790)
Error: Process completed with exit code 1.

@Scroogey-SN
Copy link
Contributor Author

Oh, the backticks in the event body get evaluted by the shell, that's where the useWalletPayment comes from.

It's unsafe passing ${{ github }} on the command line!

I'll change it to pass it through an environment variable instead. And test with various "evil" inputs. Sorry for the trouble.

@Scroogey-SN Scroogey-SN deleted the extend_awards_action branch March 2, 2025 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants