diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 38c040e4..50470690 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v3.3.0 - name: "Calculate required variables" id: variables @@ -88,7 +88,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v3.3.0 - name: "Fix ownership of repository" run: chown -R root . @@ -119,7 +119,7 @@ jobs: - name: Upload artifacts to job for later processing if: github.event_name != 'pull_request' - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v3.1.2 with: name: tmp-binary-storage path: '${{ matrix.bin_name }}*' @@ -131,10 +131,10 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v3.3.0 - name: Get Binaries built in previous jobs - uses: actions/download-artifact@v3.0.1 + uses: actions/download-artifact@v3.0.2 id: download with: name: tmp-binary-storage @@ -145,12 +145,13 @@ jobs: working-directory: ${{steps.download.outputs.download-path}} - name: Install SSH Key - uses: benoitchantre/setup-ssh-authentication-action@1.0.0 + uses: benoitchantre/setup-ssh-authentication-action@1.0.1 with: private-key: ${{ secrets.SSH_KEY }} known-hosts: ${{ secrets.KNOWN_HOSTS }} - name: Transfer Builds to Pi-hole server for pihole checkout + if: github.actor != 'dependabot[bot]' env: USER: ${{ secrets.SSH_USER }} HOST: ${{ secrets.SSH_HOST }} diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 4930242c..7b0553a6 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v3.3.0 - name: Spell-Checking uses: codespell-project/actions-codespell@master diff --git a/.github/workflows/merge-conflict.yml b/.github/workflows/merge-conflict.yml new file mode 100644 index 00000000..6722d665 --- /dev/null +++ b/.github/workflows/merge-conflict.yml @@ -0,0 +1,21 @@ +name: "Check for merge conflicts" +on: + # So that PRs touching the same files as the push are updated + push: + # So that the `dirtyLabel` is removed if conflicts are resolve + # We recommend `pull_request_target` so that github secrets are available. + # In `pull_request` we wouldn't be able to change labels of fork PRs + pull_request_target: + types: [synchronize] + +jobs: + main: + runs-on: ubuntu-latest + steps: + - name: Check if PRs are have merge conflicts + uses: eps1lon/actions-label-merge-conflict@v2.1.0 + with: + dirtyLabel: "Merge conflicts" + repoToken: "${{ secrets.GITHUB_TOKEN }}" + commentOnDirty: "This pull request has conflicts, please resolve those before we can evaluate the pull request." + commentOnClean: "Conflicts have been resolved." diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 27db3ded..9c3c9829 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -13,7 +13,7 @@ jobs: issues: write steps: - - uses: actions/stale@v6.0.1 + - uses: actions/stale@v7.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} days-before-stale: 30 diff --git a/.github/workflows/sync-back-to-dev.yml b/.github/workflows/sync-back-to-dev.yml index f689ae36..89b6323f 100644 --- a/.github/workflows/sync-back-to-dev.yml +++ b/.github/workflows/sync-back-to-dev.yml @@ -11,17 +11,8 @@ jobs: name: Syncing branches steps: - name: Checkout - uses: actions/checkout@v3.1.0 + uses: actions/checkout@v3.3.0 - name: Opening pull request - id: pull - uses: tretuna/sync-branches@1.4.0 - with: + run: gh pr create -B development -H master --title 'Sync master back into development' --body 'Created by Github action' --label 'internal' + env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - FROM_BRANCH: 'master' - TO_BRANCH: 'development' - - name: Label the pull request to ignore for release note generation - uses: actions-ecosystem/action-add-labels@v1.1.3 - with: - labels: internal - repo: ${{ github.repository }} - number: ${{ steps.pull.outputs.PULL_REQUEST_NUMBER }} diff --git a/src/args.c b/src/args.c index 2df77a88..e5917f15 100644 --- a/src/args.c +++ b/src/args.c @@ -65,7 +65,6 @@ const char** argv_dnsmasq = NULL; #define COL_ULINE "\x1b[4m" // underline font #define COL_GREEN "\x1b[32m" // normal foreground color #define COL_YELLOW "\x1b[33m" // normal foreground color -#define COL_GRAY "\x1b[90m" // bright foreground color #define COL_RED "\x1b[91m" // bright foreground color #define COL_BLUE "\x1b[94m" // bright foreground color #define COL_PURPLE "\x1b[95m" // bright foreground color @@ -431,7 +430,6 @@ void parse_args(int argc, char* argv[]) const char *normal = cli_normal(); const char *blue = cli_color(COL_BLUE); const char *cyan = cli_color(COL_CYAN); - const char *gray = cli_color(COL_GRAY); const char *green = cli_color(COL_GREEN); const char *yellow = cli_color(COL_YELLOW); const char *purple = cli_color(COL_PURPLE); @@ -458,8 +456,8 @@ void parse_args(int argc, char* argv[]) printf(" Example: %spihole-FTL regex-test %ssomebad.domain %sbad%s\n", green, blue, cyan, normal); printf(" to test %ssomebad.domain%s against %sbad%s\n\n", blue, normal, cyan, normal); - printf(" An optional %s-q%s prevents any output (exit code testing):\n", gray, normal); - printf(" %spihole-FTL %s-q%s regex-test %ssomebad.domain %sbad%s\n\n", green, gray, green, blue, cyan, normal); + printf(" An optional %s-q%s prevents any output (exit code testing):\n", purple, normal); + printf(" %spihole-FTL %s-q%s regex-test %ssomebad.domain %sbad%s\n\n", green, purple, green, blue, cyan, normal); printf("%sEmbedded Lua engine:%s\n", yellow, normal); printf("\t%s--lua%s, %slua%s FTL's lua interpreter\n", green, normal, green, normal); @@ -476,10 +474,10 @@ void parse_args(int argc, char* argv[]) printf(" the script.\n\n"); printf("%sEmbedded SQLite3 shell:%s\n", yellow, normal); - printf("\t%ssql %s[-h]%s, %ssqlite3 %s[-h]%s FTL's SQLite3 shell\n", green, gray, normal, green, gray, normal); - printf("\t%s-h%s starts a special %shuman-readable mode%s\n\n", gray, normal, bold, normal); + printf("\t%ssql %s[-h]%s, %ssqlite3 %s[-h]%s FTL's SQLite3 shell\n", green, purple, normal, green, purple, normal); + printf("\t%s-h%s starts a special %shuman-readable mode%s\n\n", purple, normal, bold, normal); - printf(" Usage: %spihole-FTL sqlite3 %s[-h] %s[OPTIONS] [FILENAME] [SQL]%s\n\n", green, gray, cyan, normal); + printf(" Usage: %spihole-FTL sqlite3 %s[-h] %s[OPTIONS] [FILENAME] [SQL]%s\n\n", green, purple, cyan, normal); printf(" Options:\n\n"); printf(" - %s[OPTIONS]%s is an optional set of options. All available\n", cyan, normal); printf(" options can be found in %spihole-FTL sqlite3 --help%s\n", green, normal); diff --git a/src/database/query-table.c b/src/database/query-table.c index 961cb132..d4d57565 100644 --- a/src/database/query-table.c +++ b/src/database/query-table.c @@ -63,8 +63,7 @@ int DB_save_queries(sqlite3 *db) return DB_FAILED; // Start database timer - if(config.debug & DEBUG_DATABASE) - timer_start(DATABASE_WRITE_TIMER); + timer_start(DATABASE_WRITE_TIMER); // Open pihole-FTL.db database file if needed bool db_opened = false;