Skip to content

Commit 198eb00

Browse files
authored
Merge pull request #3 from Arisamiga/dev
Major Changes
2 parents 3187435 + 36ee236 commit 198eb00

522 files changed

Lines changed: 13152 additions & 117139 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"env": {
3+
"commonjs": true,
4+
"es2021": true,
5+
"node": true
6+
},
7+
"extends": ["standard", "prettier"],
8+
"overrides": [],
9+
"parserOptions": {
10+
"ecmaVersion": "latest"
11+
},
12+
"rules": {},
13+
"ignorePatterns": ["dist/"]
14+
}

.github/workflows/checkDist.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# `dist/index.js` is a special file in Actions.
2+
# When you reference an action with `uses:` in a workflow,
3+
# `index.js` is the code that will run.
4+
# For our project, we generate this file through a build process from other source files.
5+
# We need to make sure the checked-in `index.js` actually matches what we expect it to be.
6+
name: Check dist/
7+
8+
on:
9+
push:
10+
branches:
11+
- master
12+
paths-ignore:
13+
- "**.md"
14+
pull_request:
15+
paths-ignore:
16+
- "**.md"
17+
workflow_dispatch:
18+
19+
jobs:
20+
check-dist:
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
26+
- name: Set Node.js 16.x
27+
uses: actions/setup-node@v3.6.0
28+
with:
29+
node-version: 16.x
30+
31+
- name: Install dependencies
32+
run: npm ci
33+
34+
- name: Rebuild the dist/ directory
35+
run: npm run prepare
36+
37+
- name: Compare the expected and actual dist/ directories
38+
run: |
39+
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
40+
echo "Detected uncommitted changes after build. See status below:"
41+
git diff
42+
exit 1
43+
fi
44+
id: diff
45+
46+
# If index.js was different than expected, upload the expected version as an artifact
47+
- uses: actions/upload-artifact@v3
48+
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
49+
with:
50+
name: dist
51+
path: dist/

.github/workflows/codeFormat.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Code Format
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
workflow_dispatch:
9+
10+
jobs:
11+
codeFormat:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Install Dependencies
18+
run: npm ci
19+
20+
- name: Run ESLint
21+
run: npx eslint .
22+
23+
- name: Run Prettier
24+
run: npx prettier --check .

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
on: # Triggers the workflow on push or pull request events but only for the main branch
1+
on: # Triggers the workflow on push or pull request events but only for the main branch
22
workflow_dispatch:
33
jobs:
44
linkedin_rss_job:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ bower_components
3838
build/Release
3939

4040
# Dependency directories
41-
# node_modules/
41+
node_modules/
4242
jspm_packages/
4343

4444
# TypeScript v1 declaration files

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Ignore markdown files
2+
*.md
3+
4+
# Ignore dist folder
5+
dist

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Linkedin-RSS
2+
23
Post the latest post from your RSS Feed to your LinkedIn Profile
34

45
<a href="https://github.com/Arisamiga/Linkedin-RSS/issues">
@@ -9,17 +10,17 @@ Post the latest post from your RSS Feed to your LinkedIn Profile
910

1011
## How to use
1112

12-
1. Create a folder named .github and create a workflows folder inside it, if it doesn't exist.
13+
1. Create a folder named .github and create a workflows folder inside it, if it doesn't exist.
1314

14-
2. Create a new .yml file with the following contents inside the workflows folder:
15+
2. Create a new .yml file with the following contents inside the workflows folder:
1516

1617
```yaml
1718
name: Linkedin blog post workflow
1819
on:
1920
schedule: # Run workflow automatically
20-
- cron: '0 * * * *' # Runs every hour, on the hour
21+
- cron: "0 * * * *" # Runs every hour, on the hour
2122
workflow_dispatch: # Run workflow manually (without waiting for the cron to be called), through the GitHub Actions Workflow page directly
22-
23+
2324
jobs:
2425
linkedin_rss_job:
2526
runs-on: ubuntu-latest
@@ -34,6 +35,7 @@ jobs:
3435
ln_access_token: # Url of LinkedIn Access Token
3536
embed_image: # Url of embed image
3637
```
38+
3739
Add on the above `feed_list` your own RSS feed URL.
3840

3941
Add on the above `ln_access_token` your LinkedIn Access Token.
@@ -44,27 +46,26 @@ Add on the above `ln_access_token` your LinkedIn Access Token.
4446

4547
Register the app in [LinkedIn Developer Network](https://developer.linkedin.com/)
4648

47-
+ Go to LinkedIn Developer Network and create an app;
48-
+ Select `Test University` or `PersonalDev` can be used as the company associated with the app without verification;
49+
- Go to LinkedIn Developer Network and create an app;
50+
- Select `Test University` or `PersonalDev` can be used as the company associated with the app without verification;
4951

5052
#
5153

52-
+ Once you made your Application go to your App and go to "Products"
53-
+ From there Select "Share on LinkedIn" and "Sign In with LinkedIn" and "Request Access" For both of them
54-
54+
- Once you made your Application go to your App and go to "Products"
55+
- From there Select "Share on LinkedIn" and "Sign In with LinkedIn" and "Request Access" For both of them
5556

5657
#
5758

58-
+ Once you have added your Products go to https://www.linkedin.com/developers/tools/oauth/
59-
+ Select "Create a new access token" and click "Create Token" Select your app and make sure you have the `r_liteprofile`, `w_member_social` scopes selected.
60-
+ Press "Request Access Token" and you will be asked to login. After Successfully logging in you will be given your Access Token.
59+
- Once you have added your Products go to https://www.linkedin.com/developers/tools/oauth/
60+
- Select "Create a new access token" and click "Create Token" Select your app and make sure you have the `r_liteprofile`, `w_member_social` scopes selected.
61+
- Press "Request Access Token" and you will be asked to login. After Successfully logging in you will be given your Access Token.
6162

6263
# Notices
6364

6465
> **I suggest for your ln_access_token you use a Github Secret. (Whats a Github Secret check here https://docs.github.com/en/actions/security-guides/encrypted-secrets)**
6566

66-
6767
> Thanks to https://github.com/gfiocco/linkedin-node-api as the LinkedIn Docs are wierd..
6868

6969
## Code and bug reporting
70+
7071
You can open a issue at https://github.com/Arisamiga/Linkedin-RSS

action.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
name: 'Linkedin-RSS'
2-
author: 'Arisamiga'
3-
description: 'Post the latest post from your RSS Feed to your Linkedin'
1+
name: "Linkedin-RSS"
2+
author: "Arisamiga"
3+
description: "Post the latest post from your RSS Feed to your Linkedin"
44
inputs:
5-
feed_list: # Url of RSS
6-
description: 'RSS Link'
5+
feed_list: # Url of RSS
6+
description: "RSS Link"
77
required: true
88
ln_access_token: # Url of LinkedIn Access Token
9-
description: 'LinkedIn Access Token | Can be Generated at (https://www.linkedin.com/developers/tools/oauth/)'
9+
description: "LinkedIn Access Token | Can be Generated at (https://www.linkedin.com/developers/tools/oauth/)"
1010
required: true
1111
embed_image: # Url of embed image
12-
description: 'Url Of image to be used as a embed image on the post'
12+
description: "Url Of image to be used as a embed image on the post"
1313
required: false
1414
runs:
15-
using: 'node16'
16-
main: 'index.js'
15+
using: "node16"
16+
main: "dist/index.js"
1717
branding:
18-
icon: 'activity'
19-
color: 'blue'
18+
icon: "activity"
19+
color: "blue"

0 commit comments

Comments
 (0)