Move to Gitea
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6m44s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6m44s
This commit is contained in:
53
.github/sudo-bot-template.js
vendored
53
.github/sudo-bot-template.js
vendored
@ -1,53 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* @param {string[]} modifiedFiles The modified files
|
||||
* @returns {string} The commit message
|
||||
*/
|
||||
const commitMessage = function (modifiedFiles) {
|
||||
return 'update: 🤖 Some updates 🤖';
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string[]} modifiedFiles The modified files
|
||||
* @returns {string} The pr message
|
||||
*/
|
||||
const prMessage = function (modifiedFiles) {
|
||||
return '🤖 Some updates to review 🤖';
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string[]} modifiedFiles The modified files
|
||||
* @returns {string} The pr content
|
||||
*/
|
||||
const prContent = function (modifiedFiles) {
|
||||
let message =
|
||||
'Dear human 🌻🐓🦃🦎🦙🐂🐏🐐🐎🦉, after running my task the following file' +
|
||||
(modifiedFiles.length > 1 ? 's where updated:' : ' was updated:') +
|
||||
'\n';
|
||||
message += modifiedFiles
|
||||
.map((file) => {
|
||||
let emoji = '👽';
|
||||
if (file.match(/.(txt)$/g)) {
|
||||
emoji = '📦';
|
||||
}
|
||||
return '- `' + file + '` ' + emoji + '\n';
|
||||
})
|
||||
.join('');
|
||||
return message;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string[]} modifiedFiles The modified files
|
||||
* @returns {string} The pr branch
|
||||
*/
|
||||
const prBranch = function (modifiedFiles) {
|
||||
return 'refs/heads/update/' + new Date().getTime();
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
commitMessage: commitMessage,
|
||||
prMessage: prMessage,
|
||||
prContent: prContent,
|
||||
prBranch: prBranch,
|
||||
};
|
97
.github/workflows/build-lists.yml
vendored
97
.github/workflows/build-lists.yml
vendored
@ -1,97 +0,0 @@
|
||||
name: Build IP lists
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
repository_dispatch:
|
||||
types: run-build-lists
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "30 0 */5 * *"
|
||||
|
||||
jobs:
|
||||
build-scanners-list:
|
||||
name: Build scanners list
|
||||
environment:
|
||||
name: sudo-bot
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
type: ["stretchoid", "binaryedge"]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Cache cargo binaries
|
||||
uses: actions/cache@v4
|
||||
id: cache-dns-ptr-resolver
|
||||
with:
|
||||
path: ~/.cargo/bin/dns-ptr-resolver
|
||||
key: ${{ runner.os }}-cargo-bin-dns-ptr-resolver-1.1.0
|
||||
- name: Set up toolchain
|
||||
if: steps.cache-dns-ptr-resolver.outputs.cache-hit != 'true'
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: 1.67
|
||||
override: true
|
||||
- name: Install dns-ptr-resolver
|
||||
if: steps.cache-dns-ptr-resolver.outputs.cache-hit != 'true'
|
||||
run: cargo install dns-ptr-resolver@1.1.0
|
||||
- name: Build the ${{ matrix.type }} list
|
||||
run: ./make-${{ matrix.type }}.sh
|
||||
- name: Post the summary
|
||||
run: |
|
||||
git add -A
|
||||
printf '### Diff\n```diff\n%s\n```\n' "$(git diff --staged)" >> $GITHUB_STEP_SUMMARY
|
||||
- name: Extract secrets
|
||||
run: |
|
||||
printf '%s' "${{ secrets.GH_APP_JWT_PRIV_PEM_CONTENTS }}" > ${HOME}/.secret_jwt.pem
|
||||
printf '%s' "${{ secrets.GPG_PRIVATE_KEY }}" > ${HOME}/.private-key.asc
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
|
||||
- name: yarn cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
- name: Install sudo-bot
|
||||
run: yarn global add sudo-bot
|
||||
- name: Run sudo-bot
|
||||
run: |
|
||||
sudo-bot --verbose \
|
||||
--jwt-file="${HOME}/.secret_jwt.pem" \
|
||||
--gh-app-id='17453' \
|
||||
--installation-id="${{ secrets.INSTALLATION_ID }}" \
|
||||
--repository-slug='wdes/security' \
|
||||
--target-branch='main' \
|
||||
--assign='williamdes' \
|
||||
--commit-author-email='sudo-bot@wdes.fr' \
|
||||
--commit-author-name='Sudo Bot' \
|
||||
--gpg-private-key-file="${HOME}/.private-key.asc" \
|
||||
--template="$GITHUB_WORKSPACE/.github/sudo-bot-template.js" \
|
||||
--gpg-private-key-passphrase="${{ secrets.GPG_PASSPHRASE }}"
|
||||
- name: Purge secrets
|
||||
if: always()
|
||||
run: |
|
||||
rm -v ${HOME}/.secret_jwt.pem
|
||||
rm -v ${HOME}/.private-key.asc
|
||||
|
||||
build-aws-cloudfront:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build the AWS CloudFront list
|
||||
run: ./make-aws-cloudfront-range.sh
|
||||
- name: Post the summary
|
||||
run: |
|
||||
git add -A
|
||||
printf '### Diff\n```diff\n%s\n```\n' "$(git diff --staged)" >> $GITHUB_STEP_SUMMARY
|
15
.github/workflows/lock.yml
vendored
15
.github/workflows/lock.yml
vendored
@ -1,15 +0,0 @@
|
||||
name: lock pull-request
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- closed
|
||||
jobs:
|
||||
lock:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: lock pull request
|
||||
uses: sudo-bot/action-pull-request-lock@v1.0.5
|
||||
with:
|
||||
github-token: ${{ secrets.SUDO_BOT_TOKEN }}
|
||||
number: ${{ github.event.pull_request.number }}
|
||||
lock-reason: resolved
|
17
.github/workflows/merge.yml
vendored
17
.github/workflows/merge.yml
vendored
@ -1,17 +0,0 @@
|
||||
name: merge pull-request
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- labeled
|
||||
jobs:
|
||||
merge:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: merge pull request
|
||||
uses: sudo-bot/action-pull-request-merge@v1.1.1
|
||||
with:
|
||||
github-token: ${{ secrets.SUDO_BOT_TOKEN }}
|
||||
number: ${{ github.event.pull_request.number }}
|
||||
allowed-usernames-regex: ^williamdes$
|
||||
filter-label: merge-it
|
||||
merge-method: fast-forward
|
Reference in New Issue
Block a user