Skip to content
Merged
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
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
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
Copy link
Collaborator

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?

Copy link
Collaborator Author

@oguzhanunlu oguzhanunlu Mar 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this pushes to referer-json branch, pointed at

ref: referer-json

an example url that I used in my test is

https://raw.githubusercontent.com/snowplow-referer-parser/referer-parser/refs/heads/referer-json/resources/referers-2025-03-14-113945.json

Copy link
Collaborator

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.yml github action, which I think you only added as a test/demo?

Copy link
Collaborator

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you also going to delete the pull_request.yml github action, which I think you only added as a test/demo?

I wasn't planning to delete it as it makes sure any change to referers.yml in a PR is valid and the file can still be converted to json.

I'll add a comment to the github action.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- 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