-
Notifications
You must be signed in to change notification settings - Fork 151
Add test action #240
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
Merged
Merged
Add test action #240
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: test | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - test* | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| release: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: referer-json | ||
| - name: Get datetime | ||
| id: datetime | ||
| run: echo "datetime=$(date "+%Y-%m-%d-%H%M%S")" >> "$GITHUB_ENV" | ||
| - name: Convert yaml to json | ||
| run: python .github/workflows/lib/yaml_to_json.py resources/referers.yml resources/referers-$datetime.json | ||
| - name: Prepare latest json | ||
| run: cp resources/referers-$datetime.json resources/referers-latest.json | ||
| - name: Commit and push new json files | ||
| run: | | ||
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
| git config --local user.name "github-actions[bot]" | ||
| git add resources/referers-$datetime.json resources/referers-latest.json | ||
| git commit -m "Add referers-$datetime.json" | ||
| git push | ||
| - name: Print test referer json URLs | ||
| run: | | ||
| echo https://raw.githubusercontent.com/snowplow-referer-parser/referer-parser/refs/heads/referer-json/resources/referers-$datetime.json | ||
| echo https://raw.githubusercontent.com/snowplow-referer-parser/referer-parser/refs/heads/referer-json/resources/referers-latest.json | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this push to a branch? And if yes, which branch?
Can you give an example of the URL that we then use for testing in the pipeline?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this pushes to
referer-jsonbranch, pointed atreferer-parser/.github/workflows/test.yml
Line 17 in 14c48b9
an example url that I used in my test is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK understood. I like that.
Are you also going to delete the
pull_request.ymlgithub action, which I think you only added as a test/demo?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And sorry one more thing... please could you add a code comment to this github action, to remind us what url to look for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't planning to delete it as it makes sure any change to
referers.ymlin a PR is valid and the file can still be converted to json.I'll add a comment to the github action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added another step to print the url e.g. https://github.com/snowplow-referer-parser/referer-parser/actions/runs/13857313589/job/38776935473#step:7:8 instead of a comment