├── .github └── workflows │ ├── actionsflow-reset-cache.yml │ ├── actionsflow-update-dependencies.yml │ ├── actionsflow-upgrade-actionsflow.yml │ └── actionsflow.yml ├── workflows ├── rss.yml └── email.yml ├── LICENSE ├── package.json ├── README.md └── .gitignore /.github/workflows/actionsflow-reset-cache.yml: -------------------------------------------------------------------------------- 1 | name: Reset Actionsflow Cache 2 | on: 3 | workflow_dispatch: 4 | jobs: 5 | reset: 6 | runs-on: ubuntu-latest 7 | name: Reset Actionsflow Cache 8 | steps: 9 | - uses: actions/checkout@v2 10 | - name: Run Actionsflow Clean 11 | uses: actionsflow/actionsflow-action@v1 12 | with: 13 | args: clean 14 | json-secrets: ${{ toJSON(secrets) }} 15 | -------------------------------------------------------------------------------- /workflows/rss.yml: -------------------------------------------------------------------------------- 1 | on: 2 | rss: 3 | url: https://hnrss.org/newest?points=300&count=3 4 | jobs: 5 | print: 6 | name: Print 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: Print Outputs 10 | env: 11 | title: ${{on.rss.outputs.title}} 12 | contentSnippet: ${{on.rss.outputs.contentSnippet}} 13 | link: ${{on.rss.outputs.link}} 14 | run: | 15 | echo title: $title 16 | echo contentSnippet: $contentSnippet 17 | echo link: $link 18 | -------------------------------------------------------------------------------- /workflows/email.yml: -------------------------------------------------------------------------------- 1 | on: 2 | webhook: 3 | method: post 4 | jobs: 5 | request: 6 | name: Request 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: Make a HTTP Request 10 | uses: actionsflow/axios@main 11 | with: 12 | url: https://www.swr.de/ 13 | method: POST 14 | body: | 15 | { 16 | "link":"${{on.rss.outputs.link}}", 17 | "title": "${{on.rss.outputs.title}}", 18 | "content":"<<<${{on.rss.outputs.contentSnippet}}>>>" 19 | } 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The BSD Zero Clause License (0BSD) 2 | 3 | Copyright (c) 2020 Actionsflow Inc. 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 9 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 10 | AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 11 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 12 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 13 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 14 | PERFORMANCE OF THIS SOFTWARE. -------------------------------------------------------------------------------- /.github/workflows/actionsflow-update-dependencies.yml: -------------------------------------------------------------------------------- 1 | name: Update All Dependencies 2 | on: 3 | workflow_dispatch: 4 | jobs: 5 | update: 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v2 9 | with: 10 | fetch-depth: 0 11 | - name: Checkout Branch 12 | run: git checkout main 13 | - name: Configure CI Git User 14 | run: | 15 | git config user.name github-actions[bot] 16 | git config user.email github-actions[bot]@users.noreply.github.com 17 | - name: Update 18 | run: | 19 | npm ci 20 | npm update 21 | - name: Git Push 22 | run: | 23 | git add package.json package-lock.json 24 | git commit -m "chore: update dependencies" 25 | git push -------------------------------------------------------------------------------- /.github/workflows/actionsflow-upgrade-actionsflow.yml: -------------------------------------------------------------------------------- 1 | name: Upgrade Local Actionsflow 2 | on: 3 | workflow_dispatch: 4 | repository_dispatch: 5 | types: [new_version_with_actionsflow] 6 | jobs: 7 | update: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v2 11 | with: 12 | fetch-depth: 0 13 | - name: Checkout Branch 14 | run: git checkout main 15 | - name: Configure CI Git User 16 | run: | 17 | git config user.name github-actions[bot] 18 | git config user.email github-actions[bot]@users.noreply.github.com 19 | - name: Update 20 | run: | 21 | npm ci 22 | npm update actionsflow 23 | - name: Git Push 24 | run: | 25 | git add package.json package-lock.json 26 | git commit -m "chore: upgrade actionsflow dependencies" 27 | git push -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "actionsflow-workflow-default", 3 | "private": true, 4 | "description": "A simple workflow to get up and build quickly with Actionsflow", 5 | "version": "1.0.2", 6 | "author": "Owen Young ", 7 | "devDependencies": { 8 | "actionsflow": "^1.12.1" 9 | }, 10 | "keywords": [ 11 | "actionsflow", 12 | "workflow" 13 | ], 14 | "license": "0BSD", 15 | "scripts": { 16 | "build": "actionsflow build", 17 | "start": "actionsflow start", 18 | "watch": "actionsflow start -w", 19 | "act": "act --workflows ./dist/workflows --secret-file ./dist/.secrets --eventpath ./dist/event.json --env-file ./dist/.env -P ubuntu-latest=actionsflow/act-environment:v1 -P ubuntu-18.04=actionsflow/act-environment:v1", 20 | "clean": "actionsflow clean", 21 | "test": "echo \"Error: no test specified\" && exit 1" 22 | }, 23 | "repository": { 24 | "type": "git", 25 | "url": "https://github.com/actionsflow/actionsflow-workflow-default" 26 | }, 27 | "bugs": { 28 | "url": "https://github.com/actionsflow/actionsflow-workflow-default/issues" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /.github/workflows/actionsflow.yml: -------------------------------------------------------------------------------- 1 | name: Actionsflow 2 | on: 3 | # schedule: 4 | # - cron: "*/15 * * * *" 5 | push: 6 | branches: 7 | - main 8 | repository_dispatch: 9 | workflow_dispatch: 10 | inputs: 11 | include: 12 | description: "--include: workflow file filter, you can use glob format to filter your workflows, the default value is empty value, means no filter will be using" 13 | required: false 14 | default: "" 15 | force: 16 | description: "--force: whether force to run workflow, true or false" 17 | required: false 18 | default: "false" 19 | verbose: 20 | description: "--verbose: debug workflow, true or false" 21 | required: false 22 | default: "false" 23 | jobs: 24 | run: 25 | runs-on: ubuntu-latest 26 | name: Run 27 | concurrency: actionsflow 28 | steps: 29 | - uses: actions/checkout@v3 30 | - name: Run Actionsflow 31 | uses: actionsflow/actionsflow-action@v1.3.0 32 | with: 33 | args: "build --include ${{ github.event.inputs.include || ''}} -f ${{github.event.inputs.force=='true' && 'true' || 'false'}} --verbose ${{github.event.inputs.verbose=='true' && 'true' || 'false'}}" 34 | json-secrets: ${{ toJSON(secrets) }} 35 | json-github: ${{ toJSON(github) }} 36 | - name: Setup act 37 | uses: actionsflow/setup-act-for-actionsflow@v1.2.0 38 | - name: Run act 39 | run: act --workflows ./dist/workflows --secret-file ./dist/.secrets --eventpath ./dist/event.json --env-file ./dist/.env -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-latest 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | This is a workflow repository powered by [Actionsflow](https://github.com/actionsflow/actionsflow), generated from [actionsflow/actionsflow-workflow-default](https://github.com/actionsflow/actionsflow-workflow-default) 3 | 4 | # 🏁 Getting Started 5 | 6 | Build an Actionsflow workflow is a four-step process: 7 | 8 | 1. **Create a public Github repository by this [link](https://github.com/actionsflow/actionsflow-workflow-default/generate).** 9 | 10 | A typical Actionsflow repository structure looks like this: 11 | 12 | ```sh 13 | ├── .github 14 | │ └── workflows 15 | │ └── actionsflow.yml 16 | ├── .gitignore 17 | ├── README.md 18 | └── workflows 19 | │ └── rss.yml 20 | │ └── webhook.yml 21 | └── package.json 22 | ``` 23 | 24 | 1. **Uncomment [`.github/workflows/actionsflow.yml`](/.github/workflows/actionsflow.yml) schedule event** 25 | 26 | ```yml 27 | on: 28 | schedule: 29 | - cron: "*/15 * * * *" 30 | ``` 31 | > Note: To prevent abuse, by default, the schedule is commented, please modify the schedule time according to your own needs, the default is once every 15 minutes. Learn more about schedule event, please see [here](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#schedule) 32 | 33 | 1. **Define your [workflow file](https://actionsflow.github.io/docs/workflow/) at `workflows` directory** 34 | 35 | A typical workflow file `rss.yml` looks like this: 36 | 37 | ```yaml 38 | on: 39 | rss: 40 | url: https://hnrss.org/newest?points=300&count=3 41 | jobs: 42 | request: 43 | name: Make a HTTP Request 44 | runs-on: ubuntu-latest 45 | steps: 46 | - name: Make a HTTP Request 47 | uses: actionsflow/axios@v1 48 | with: 49 | url: https://hookb.in/VGPzxoWbdjtE22bwznzE 50 | method: POST 51 | body: | 52 | { 53 | "link":"${{ on.rss.outputs.link }}", 54 | "title": "${{ on.rss.outputs.title }}", 55 | "content":"<<<${{ on.rss.outputs.contentSnippet }}>>>" 56 | } 57 | ``` 58 | 59 | For more information about the Actionsflow workflow file, see the 60 | [Actionsflow workflow reference](https://actionsflow.github.io/docs/workflow/). 61 | 62 | You can explore [Triggers List](https://actionsflow.github.io/docs/triggers/) or [Awesome Actionsflow Workflows](https://github.com/actionsflow/awesome-actionsflow) to get more inspired. 63 | 64 | 1. **Commit and push your updates to Github** 65 | 66 | Then, Actionsflow will run your workflows as you defined, you can view logs at your repository actions tab at [Github](https://github.com) 67 | 68 | For more information, see [Full documentation](https://actionsflow.github.io/docs/) 69 | 70 | ## Run Locally 71 | 72 | You can run self-hosted Actionsflow manually or [by docker](https://actionsflow.github.io/docs/self-hosted/#docker): 73 | 74 | ## Prerequisites 75 | 76 | 1. Install [docker](https://docs.docker.com/get-docker/) 77 | 1. Install [act](https://github.com/nektos/act) 78 | 1. Install dependencies by running `npm install` 79 | 80 | ### Start 81 | 82 | Start Actionsflow locally: 83 | 84 | ```bash 85 | npm run start 86 | # Then, the cron job and webhook server will start running 87 | # The webhook endpoint will be ran at http://localhost:3000/webhook/ 88 | ``` 89 | 90 | ### Build 91 | 92 | ```bash 93 | npm run build 94 | # Then, the standard workflow files will be built at ./dist/workflows 95 | ``` 96 | 97 | ### Clean 98 | 99 | Actionsflow build will use cache for deduplicating the data, if you want to test your workflow with the same data, you may need to clean the cache by the following command: 100 | 101 | ```bash 102 | # Clean the cache and dist folder. 103 | npm run clean 104 | ``` 105 | 106 | Learn more abount self-hosted Actionsflow [here](https://actionsflow.github.io/docs/self-hosted) 107 | 108 | 109 | # 🎓 Learn More 110 | 111 | Full documentation for Actionsflow lives [on the website](https://actionsflow.github.io/docs/). 112 | 113 | - [Workflow Syntax for Actionsflow](https://actionsflow.github.io/docs/workflow/) - Learn more about the Actionsflow workflow file syntax 114 | - [Triggers List](https://actionsflow.github.io/docs/triggers/) - Explore Actionsflow triggers 115 | - [Awesome Actionsflow Workflows](https://github.com/actionsflow/awesome-actionsflow) - Explore Actionsflow workflows use case to get inspired 116 | - [Core Concepts](https://actionsflow.github.io/docs/concepts/) - Learn more about how Actionsflow worked 117 | - [Creating Triggers for Actionsflow](https://actionsflow.github.io/docs/creating-triggers/) - Learn more about how to create your own trigger for Actionsflow 118 | - [FAQs](https://actionsflow.github.io/docs/faqs/) - Actionsflow FAQs 119 | - [Upgrade Guide](https://actionsflow.github.io/docs/upgrade/) 120 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # General 2 | .DS_Store 3 | .AppleDouble 4 | .LSOverride 5 | 6 | # Icon must end with two \r 7 | Icon 8 | 9 | # Actionsflow 10 | actionsflow-cache-key.txt 11 | .actionsflow 12 | .secrets 13 | # Thumbnails 14 | ._* 15 | 16 | # Files that might appear in the root of a volume 17 | .DocumentRevisions-V100 18 | .fseventsd 19 | .Spotlight-V100 20 | .TemporaryItems 21 | .Trashes 22 | .VolumeIcon.icns 23 | .com.apple.timemachine.donotpresent 24 | 25 | # Directories potentially created on remote AFP share 26 | .AppleDB 27 | .AppleDesktop 28 | Network Trash Folder 29 | Temporary Items 30 | .apdisk 31 | 32 | # Windows thumbnail cache files 33 | Thumbs.db 34 | Thumbs.db:encryptable 35 | ehthumbs.db 36 | ehthumbs_vista.db 37 | 38 | # Dump file 39 | *.stackdump 40 | 41 | # Folder config file 42 | [Dd]esktop.ini 43 | 44 | # Recycle Bin used on file shares 45 | $RECYCLE.BIN/ 46 | 47 | # Windows Installer files 48 | *.cab 49 | *.msi 50 | *.msix 51 | *.msm 52 | *.msp 53 | 54 | # Windows shortcuts 55 | *.lnk 56 | 57 | .vscode/* 58 | !.vscode/settings.json 59 | !.vscode/tasks.json 60 | !.vscode/launch.json 61 | !.vscode/extensions.json 62 | *.code-workspace 63 | 64 | # Local History for Visual Studio Code 65 | .history/ 66 | 67 | # Cache files for Sublime Text 68 | *.tmlanguage.cache 69 | *.tmPreferences.cache 70 | *.stTheme.cache 71 | 72 | # Workspace files are user-specific 73 | *.sublime-workspace 74 | 75 | # Project files should be checked into the repository, unless a significant 76 | # proportion of contributors will probably not be using Sublime Text 77 | # *.sublime-project 78 | 79 | # SFTP configuration file 80 | sftp-config.json 81 | sftp-config-alt*.json 82 | 83 | # Package control specific files 84 | Package Control.last-run 85 | Package Control.ca-list 86 | Package Control.ca-bundle 87 | Package Control.system-ca-bundle 88 | Package Control.cache/ 89 | Package Control.ca-certs/ 90 | Package Control.merged-ca-bundle 91 | Package Control.user-ca-bundle 92 | oscrypto-ca-bundle.crt 93 | bh_unicode_properties.cache 94 | 95 | # Sublime-github package stores a github token in this file 96 | # https://packagecontrol.io/packages/sublime-github 97 | GitHub.sublime-settings 98 | 99 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider 100 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 101 | 102 | # User-specific stuff 103 | .idea/**/workspace.xml 104 | .idea/**/tasks.xml 105 | .idea/**/usage.statistics.xml 106 | .idea/**/dictionaries 107 | .idea/**/shelf 108 | 109 | # Generated files 110 | .idea/**/contentModel.xml 111 | 112 | # Sensitive or high-churn files 113 | .idea/**/dataSources/ 114 | .idea/**/dataSources.ids 115 | .idea/**/dataSources.local.xml 116 | .idea/**/sqlDataSources.xml 117 | .idea/**/dynamic.xml 118 | .idea/**/uiDesigner.xml 119 | .idea/**/dbnavigator.xml 120 | 121 | # Gradle 122 | .idea/**/gradle.xml 123 | .idea/**/libraries 124 | 125 | # Gradle and Maven with auto-import 126 | # When using Gradle or Maven with auto-import, you should exclude module files, 127 | # since they will be recreated, and may cause churn. Uncomment if using 128 | # auto-import. 129 | # .idea/artifacts 130 | # .idea/compiler.xml 131 | # .idea/jarRepositories.xml 132 | # .idea/modules.xml 133 | # .idea/*.iml 134 | # .idea/modules 135 | # *.iml 136 | # *.ipr 137 | 138 | # CMake 139 | cmake-build-*/ 140 | 141 | # Mongo Explorer plugin 142 | .idea/**/mongoSettings.xml 143 | 144 | # File-based project format 145 | *.iws 146 | 147 | # IntelliJ 148 | out/ 149 | 150 | # mpeltonen/sbt-idea plugin 151 | .idea_modules/ 152 | 153 | # JIRA plugin 154 | atlassian-ide-plugin.xml 155 | 156 | # Cursive Clojure plugin 157 | .idea/replstate.xml 158 | 159 | # Crashlytics plugin (for Android Studio and IntelliJ) 160 | com_crashlytics_export_strings.xml 161 | crashlytics.properties 162 | crashlytics-build.properties 163 | fabric.properties 164 | 165 | # Editor-based Rest Client 166 | .idea/httpRequests 167 | 168 | # Android studio 3.1+ serialized cache file 169 | .idea/caches/build_file_checksums.ser 170 | 171 | _site/ 172 | .sass-cache/ 173 | .jekyll-cache/ 174 | .jekyll-metadata 175 | 176 | # Logs 177 | logs 178 | *.log 179 | npm-debug.log* 180 | yarn-debug.log* 181 | yarn-error.log* 182 | lerna-debug.log* 183 | 184 | # Diagnostic reports (https://nodejs.org/api/report.html) 185 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 186 | 187 | # Runtime data 188 | pids 189 | *.pid 190 | *.seed 191 | *.pid.lock 192 | 193 | # Directory for instrumented libs generated by jscoverage/JSCover 194 | lib-cov 195 | 196 | # Coverage directory used by tools like istanbul 197 | coverage 198 | *.lcov 199 | 200 | # nyc test coverage 201 | .nyc_output 202 | 203 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 204 | .grunt 205 | 206 | # Bower dependency directory (https://bower.io/) 207 | bower_components 208 | 209 | # node-waf configuration 210 | .lock-wscript 211 | 212 | # Compiled binary addons (https://nodejs.org/api/addons.html) 213 | build/Release 214 | 215 | # Dependency directories 216 | node_modules/ 217 | jspm_packages/ 218 | 219 | # Snowpack dependency directory (https://snowpack.dev/) 220 | web_modules/ 221 | 222 | # TypeScript cache 223 | *.tsbuildinfo 224 | 225 | # Optional npm cache directory 226 | .npm 227 | 228 | # Optional eslint cache 229 | .eslintcache 230 | 231 | # Microbundle cache 232 | .rpt2_cache/ 233 | .rts2_cache_cjs/ 234 | .rts2_cache_es/ 235 | .rts2_cache_umd/ 236 | 237 | # Optional REPL history 238 | .node_repl_history 239 | 240 | # Output of 'npm pack' 241 | *.tgz 242 | 243 | # Yarn Integrity file 244 | .yarn-integrity 245 | 246 | # dotenv environment variables file 247 | .env 248 | .env.test 249 | 250 | # parcel-bundler cache (https://parceljs.org/) 251 | .cache 252 | .parcel-cache 253 | 254 | # Next.js build output 255 | .next 256 | out 257 | 258 | # Nuxt.js build / generate output 259 | .nuxt 260 | dist 261 | 262 | # Gatsby files 263 | .cache/ 264 | # Comment in the public line in if your project uses Gatsby and not Next.js 265 | # https://nextjs.org/blog/next-9-1#public-directory-support 266 | # public 267 | 268 | # vuepress build output 269 | .vuepress/dist 270 | 271 | # Serverless directories 272 | .serverless/ 273 | 274 | # FuseBox cache 275 | .fusebox/ 276 | 277 | # DynamoDB Local files 278 | .dynamodb/ 279 | 280 | # TernJS port file 281 | .tern-port 282 | 283 | # Stores VSCode versions used for testing VSCode extensions 284 | .vscode-test 285 | 286 | # yarn v2 287 | .yarn/cache 288 | .yarn/unplugged 289 | .yarn/build-state.yml 290 | .yarn/install-state.gz 291 | .pnp.* 292 | --------------------------------------------------------------------------------