Skip to content

Commit 3cefda1

Browse files
authored
Merge pull request #664 from rollbar/updated/rollbar-js-snippet
Added workflow to automaticly update the rollbar.snippet.js
2 parents 285d485 + 89f2fac commit 3cefda1

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: update_js_snippet.yml
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: 'Version'
7+
required: false
8+
default: 'latest'
9+
type: string
10+
11+
jobs:
12+
update_js_snippet:
13+
name: Update JS Snippet
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Set up JS
19+
run: npm init -y
20+
21+
- name: Install Rollbar
22+
run: npm install --save-dev rollbar@${{ github.event.inputs.version }}
23+
24+
- name: Update JS Snippet
25+
run: cp -f node_modules/rollbar/dist/rollbar.snippet.js data/rollbar.snippet.js
26+
27+
- name: Capture Version
28+
id: capture_version
29+
run: |
30+
echo "ROLLBAR_VERSION=$(node -p "require('./node_modules/rollbar/package.json').version")" >> $GITHUB_OUTPUT
31+
32+
- name: Create Pull Request
33+
uses: peter-evans/create-pull-request@v6
34+
with:
35+
token: ${{ secrets.GITHUB_TOKEN }}
36+
commit-message: Update JS Snippet to ${{ steps.capture_version.outputs.ROLLBAR_VERSION }}
37+
title: Update JS Snippet to ${{ steps.capture_version.outputs.ROLLBAR_VERSION }}
38+
add-paths: |
39+
data/rollbar.snippet.js
40+
body: |
41+
Updated the JS snippet to version `${{ steps.capture_version.outputs.ROLLBAR_VERSION }}` of [Rollbar.js][1].
42+
43+
[1]: https://github.com/rollbar/rollbar.js
44+
branch: updated/js-snippet
45+
base: master
46+
reviewers: danielmorell
47+
assignees: danielmorell

0 commit comments

Comments
 (0)